Skip to content

OCPBUGS-78995: Azure: Default Marketplace image (for hive) - #10707

Closed
2uasimojo wants to merge 1 commit into
openshift:mainfrom
2uasimojo:OCPBUGS-78995/azure-default-marketplace-image
Closed

OCPBUGS-78995: Azure: Default Marketplace image (for hive)#10707
2uasimojo wants to merge 1 commit into
openshift:mainfrom
2uasimojo:OCPBUGS-78995/azure-default-marketplace-image

Conversation

@2uasimojo

@2uasimojo 2uasimojo commented Jul 22, 2026

Copy link
Copy Markdown
Member

In a path that should only be reachable from hive's MachinePool controller, if no RHCOS image reference was provided, we were defaulting to an empty capz.Image{} and letting MAO/MCO figure out what to use. This wasn't working very well.

Here we hardcode the oldest marketplace image in this path instead. This should end up being forward compatible; and the in-cluster operators should eventually be able to upgrade it as needed.

This is one part of a two-part solution. The other part entails hive improving its discovery of gallery images and (VM and image) HyperVGenerations, which will need to be in place when they vendor this change in.

Summary by CodeRabbit

  • New Features
    • Azure machine deployments now select RHCOS images based on the target CPU architecture.
    • When no custom RHCOS image is provided, Azure marketplace defaults are chosen that match the architecture and generation (including ARM64 and V2 variants).
    • This ensures the installer resolves the correct marketplace image set for the selected hardware type.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 22, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@2uasimojo: This pull request references Jira Issue OCPBUGS-78995, which is invalid:

  • expected the bug to target either version "5.0." or "openshift-5.0.", but it targets "4.22.0" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

In a path that should only be reachable from hive's MachinePool controller, if no RHCOS image reference was provided, we were defaulting to an empty capz.Image{} and letting MAO/MCO figure out what to use. This wasn't working very well.

Here we hardcode the oldest marketplace image in this path instead. This should end up being forward compatible; and the in-cluster operators should eventually be able to upgrade it as needed.

This is one part of a two-part solution. The other part entails hive improving its discovery of gallery images and (VM and image) HyperVGenerations, which will need to be in place when they vendor this change in.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: c19afd79-2d27-4306-9b19-4736c5aa40bb

📥 Commits

Reviewing files that changed from the base of the PR and between 9ca5074 and 77cfd19.

📒 Files selected for processing (3)
  • pkg/asset/installconfig/azure/capabilities.go
  • pkg/asset/machines/azure/azuremachines.go
  • pkg/asset/machines/azure/machines.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • pkg/asset/installconfig/azure/capabilities.go
  • pkg/asset/machines/azure/machines.go
  • pkg/asset/machines/azure/azuremachines.go

📝 Walkthrough

Walkthrough

Changes

Azure image selection

Layer / File(s) Summary
Architecture resolution and propagation
pkg/asset/installconfig/azure/capabilities.go, pkg/asset/machines/azure/machines.go, pkg/asset/machines/azure/azuremachines.go
Maps CpuArchitectureType to ARM64 or AMD64 and forwards the result through Azure machine image generation.
Marketplace RHCOS selection
pkg/asset/machines/azure/azuremachines.go
When no custom RHCOS image is configured for a non-confidential VM, returns marketplace metadata with SKU selection based on architecture and VM generation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: defaulting Azure to a marketplace image for Hive.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The PR only changes Azure production code; no Ginkgo test declarations or titles were added or modified in the touched files.
Test Structure And Quality ✅ Passed No Ginkgo test code was added or modified; the PR only changes production Azure image-selection logic.
Microshift Test Compatibility ✅ Passed Only Azure helper/library code changed; no Ginkgo e2e tests or MicroShift-sensitive test markers were added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only changes Azure machine/image plumbing, so the SNO test-compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed Only Azure VM image selection and architecture detection changed; no replicas, affinities, node selectors, or topology-spread constraints were added.
Ote Binary Stdout Contract ✅ Passed The PR only changes library helpers and image-selection logic; no main/init/TestMain/suite setup or stdout/logging writes were added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only changes Azure installer helper code, not test bodies.
No-Weak-Crypto ✅ Passed No weak crypto, custom crypto, or secret-comparison logic appears in the touched Azure files; the patch only changes architecture/image selection.
Container-Privileges ✅ Passed Only Go files changed; no container/K8s manifests or privilege settings were added, so the container-privileges check is not applicable.
No-Sensitive-Data-In-Logs ✅ Passed No new log statements were added; the only existing log in the touched code logs only the instance type, not secrets/PII/internal hostnames.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested review from rna-afk and sadasu July 22, 2026 20:56
@openshift-ci

openshift-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jhixson74 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/asset/machines/azure/azuremachines.go`:
- Around line 403-422: Add table-driven tests covering the Azure
marketplace-image selection chain: test GetArchitecture, mapiImage/capzImage,
and GenerateMachines for Arm64 → 420-arm, AMD64 Gen2 → 420-v2, and AMD64
non-Gen2 → aro_420. Cover the affected flow across
pkg/asset/machines/azure/azuremachines.go (lines 403-422 and 66),
pkg/asset/installconfig/azure/capabilities.go (lines 51-58), and
pkg/asset/machines/azure/machines.go (lines 186 and 437-439); no production
changes are required unless needed to make these tests exercise the existing
mapping.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 7d98a00f-6276-4b2c-824b-0062d8917646

📥 Commits

Reviewing files that changed from the base of the PR and between b7140c7 and 9ca5074.

📒 Files selected for processing (3)
  • pkg/asset/installconfig/azure/capabilities.go
  • pkg/asset/machines/azure/azuremachines.go
  • pkg/asset/machines/azure/machines.go

Comment thread pkg/asset/machines/azure/azuremachines.go
In a path that _should_ only be reachable from hive's MachinePool
controller, if no RHCOS image reference was provided, we were defaulting
to an empty `capz.Image{}` and letting MAO/MCO figure out what to use.
This wasn't working very well.

Here we hardcode the oldest marketplace image in this path instead. This
should end up being forward compatible; and the in-cluster operators
should eventually be able to upgrade it as needed.

This is one part of a two-part solution. The other part entails hive
improving its discovery of gallery images and (VM and image)
HyperVGenerations, which will need to be in place when they vendor this
change in.
@2uasimojo
2uasimojo force-pushed the OCPBUGS-78995/azure-default-marketplace-image branch from 9ca5074 to 77cfd19 Compare July 22, 2026 21:57
@2uasimojo

Copy link
Copy Markdown
Member Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 22, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@2uasimojo: This pull request references Jira Issue OCPBUGS-78995, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@2uasimojo: This pull request references Jira Issue OCPBUGS-78995, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

In a path that should only be reachable from hive's MachinePool controller, if no RHCOS image reference was provided, we were defaulting to an empty capz.Image{} and letting MAO/MCO figure out what to use. This wasn't working very well.

Here we hardcode the oldest marketplace image in this path instead. This should end up being forward compatible; and the in-cluster operators should eventually be able to upgrade it as needed.

This is one part of a two-part solution. The other part entails hive improving its discovery of gallery images and (VM and image) HyperVGenerations, which will need to be in place when they vendor this change in.

Summary by CodeRabbit

  • New Features
  • Azure machine deployments now select RHCOS images based on the target CPU architecture.
  • When no custom RHCOS image is provided, Azure marketplace defaults are chosen that match the architecture and generation (including ARM64 and V2 variants).
  • This ensures the installer resolves the correct marketplace image set for the selected hardware type.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@tthvo

tthvo commented Jul 23, 2026

Copy link
Copy Markdown
Member

/retest

@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@2uasimojo: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@2uasimojo

Copy link
Copy Markdown
Member Author

/hold

I think this has the potential to regress some edge cases. Still pondering design possibilities.

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 23, 2026
@2uasimojo

Copy link
Copy Markdown
Member Author

/close

in favor of #10712.

@openshift-ci openshift-ci Bot closed this Jul 24, 2026
@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

@2uasimojo: Closed this PR.

Details

In response to this:

/close

in favor of #10712.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@2uasimojo: This pull request references Jira Issue OCPBUGS-78995. The bug has been updated to no longer refer to the pull request using the external bug tracker.

Details

In response to this:

In a path that should only be reachable from hive's MachinePool controller, if no RHCOS image reference was provided, we were defaulting to an empty capz.Image{} and letting MAO/MCO figure out what to use. This wasn't working very well.

Here we hardcode the oldest marketplace image in this path instead. This should end up being forward compatible; and the in-cluster operators should eventually be able to upgrade it as needed.

This is one part of a two-part solution. The other part entails hive improving its discovery of gallery images and (VM and image) HyperVGenerations, which will need to be in place when they vendor this change in.

Summary by CodeRabbit

  • New Features
  • Azure machine deployments now select RHCOS images based on the target CPU architecture.
  • When no custom RHCOS image is provided, Azure marketplace defaults are chosen that match the architecture and generation (including ARM64 and V2 variants).
  • This ensures the installer resolves the correct marketplace image set for the selected hardware type.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@2uasimojo
2uasimojo deleted the OCPBUGS-78995/azure-default-marketplace-image branch July 24, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants