Skip to content

MGMT-23060: Make InfraEnv CpuArchitecture immutable after creation#9999

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:masterfrom
bluesort:mgmt-23060
Mar 30, 2026
Merged

MGMT-23060: Make InfraEnv CpuArchitecture immutable after creation#9999
openshift-merge-bot[bot] merged 1 commit intoopenshift:masterfrom
bluesort:mgmt-23060

Conversation

@bluesort
Copy link
Copy Markdown
Member

@bluesort bluesort commented Mar 11, 2026

Changing Spec.CpuArchitecture after InfraEnv creation didn't regenerate boot artifacts, causing download links to point to the wrong architecture (e.g., links still pointed to x86_64 after changing to s390x). This fix makes Spec.CpuArchitecture immutable by adding webhook validation that rejects any attempts to modify the field after creation, preventing the inconsistent state.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 11, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 11, 2026

@bluesort: This pull request references MGMT-23060 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Changing Spec.CpuArchitecture after InfraEnv creation didn't regenerate boot artifacts, causing download links to point to the wrong architecture (e.g., links still pointed to x86_64 after changing to s390x). This fix makes Spec.CpuArchitecture immutable by adding webhook validation that rejects any attempts to modify the field after creation, preventing the inconsistent state.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • [x ] Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • [] None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • [x ] Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • [] No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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
Copy link
Copy Markdown

coderabbitai Bot commented Mar 11, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 06c1564a-dc1c-48bf-b350-1fe0dd551897

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds webhook validation that prevents changing an InfraEnv's Spec.CpuArchitecture after creation (treating empty as x86_64), updates tests covering update scenarios, and documents the immutability requirement.

Changes

Cohort / File(s) Summary
Documentation
docs/user-guide/multiarch-and-heterogeneous-openshift.md
Added an IMPORTANT note explaining cpu_architecture on an InfraEnv is immutable and requires deletion and recreation to change.
Webhook Implementation
pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook.go
Added defaultCPUArchitecture = "x86_64" and areCpuArchsEqual(old, new string) bool helper; extended validateUpdate to deny updates that change Spec.CpuArchitecture (after defaulting empty values).
Webhook Tests
pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook_test.go
Added test cases for admissionv1.Update covering CPU architecture update behavior: disallow changing non-empty values, allow empty↔default transitions and unchanged values.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ❓ Inconclusive Test file infraenv_admission_hook_test.go does not exist in the repository. Cannot assess Ginkgo test quality compliance. Verify the test file location and ensure it is committed to the repository before re-running this check.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: making InfraEnv CpuArchitecture immutable after creation, which directly addresses the bug fix in the changeset.
Description check ✅ Passed The PR description is complete, addressing the root cause of the bug, explaining the fix approach, and properly filling out the provided template with all key sections marked appropriately.
Stable And Deterministic Test Names ✅ Passed All test names in the modified test file use static, descriptive strings with no dynamic values such as timestamps, UUIDs, pod names, or IP addresses.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 11, 2026

@bluesort: This pull request references MGMT-23060 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Changing Spec.CpuArchitecture after InfraEnv creation didn't regenerate boot artifacts, causing download links to point to the wrong architecture (e.g., links still pointed to x86_64 after changing to s390x). This fix makes Spec.CpuArchitecture immutable by adding webhook validation that rejects any attempts to modify the field after creation, preventing the inconsistent state.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • [] None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • [] No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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 openshift-ci Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 11, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 11, 2026

@bluesort: This pull request references MGMT-23060 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Changing Spec.CpuArchitecture after InfraEnv creation didn't regenerate boot artifacts, causing download links to point to the wrong architecture (e.g., links still pointed to x86_64 after changing to s390x). This fix makes Spec.CpuArchitecture immutable by adding webhook validation that rejects any attempts to modify the field after creation, preventing the inconsistent state.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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 openshift-ci Bot requested review from adriengentil and maorfr March 11, 2026 18:48
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 11, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 11, 2026

@bluesort: This pull request references MGMT-23060 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Changing Spec.CpuArchitecture after InfraEnv creation didn't regenerate boot artifacts, causing download links to point to the wrong architecture (e.g., links still pointed to x86_64 after changing to s390x). This fix makes Spec.CpuArchitecture immutable by adding webhook validation that rejects any attempts to modify the field after creation, preventing the inconsistent state.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Summary by CodeRabbit

Release Notes

  • Documentation

  • Added clarification that CPU architecture is immutable after InfraEnv creation; modifications require deletion and recreation.

  • Bug Fixes

  • System now enforces CPU architecture immutability and rejects updates that attempt to change this field.

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook_test.go (1)

218-239: Missing test coverage for empty-string edge cases.

The tests cover the explicit change scenario (x86_64s390x) and the no-change scenario, but do not cover:

  1. Transition from "" (empty/unset) to "x86_64" — would this be blocked or allowed?
  2. Transition from "" to a different architecture like "arm64"
  3. Transition from "x86_64" to "" (clearing the field)

These edge cases are important because existing InfraEnvs created without explicitly setting CpuArchitecture will have an empty string stored.

📝 Suggested additional test cases
{
	name: "Test InfraEnv.Spec.CpuArchitecture can't change from empty to non-default",
	newSpec: v1beta1.InfraEnvSpec{
		CpuArchitecture: models.ClusterCPUArchitectureArm64,
	},
	oldSpec: v1beta1.InfraEnvSpec{
		CpuArchitecture: "",
	},
	operation:       admissionv1.Update,
	expectedAllowed: false, // or true, depending on desired behavior
},
{
	name: "Test InfraEnv.Spec.CpuArchitecture transition from empty to default",
	newSpec: v1beta1.InfraEnvSpec{
		CpuArchitecture: models.ClusterCPUArchitectureX8664,
	},
	oldSpec: v1beta1.InfraEnvSpec{
		CpuArchitecture: "",
	},
	operation:       admissionv1.Update,
	expectedAllowed: true, // semantically the same as default
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook_test.go` around
lines 218 - 239, Add table-driven test cases in infraenv_admission_hook_test.go
to cover empty-string edge cases for CpuArchitecture: add cases where
oldSpec.CpuArchitecture == "" and newSpec is models.ClusterCPUArchitectureX8664
(expectedAllowed true if treated as default) and where oldSpec.CpuArchitecture
== "" and newSpec is models.ClusterCPUArchitectureArm64 (expectedAllowed false
if disallowed), and a case where oldSpec has models.ClusterCPUArchitectureX8664
and newSpec.CpuArchitecture == "" (expectedAllowed false if clearing is
disallowed); ensure these new entries are added to the same test cases slice
used by the Test InfraEnv admission logic (the table that iterates over name,
newSpec, oldSpec, operation, expectedAllowed) and use admissionv1.Update for
operation so they run alongside the existing CpuArchitecture immutability tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook.go`:
- Around line 257-268: The immutability check in the CpuArchitecture comparison
blocks changes from blocking empty->default transitions; update the check in
infraenv_admission_hook.go (the block that compares
oldObject.Spec.CpuArchitecture and newObject.Spec.CpuArchitecture) to normalize
empty string to the API default "x86_64" before comparing (either by small
helper normalizeCpuArch(value string) string or inline), so "" is treated as
"x86_64" and does not trigger a failed validation when new is explicitly
"x86_64"; also add a unit test covering the edge case oldSpec.CpuArchitecture ==
"" and newSpec.CpuArchitecture == "x86_64" (expected allowed) mirroring how
areClusterRefsEqual handles nils.

---

Nitpick comments:
In `@pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook_test.go`:
- Around line 218-239: Add table-driven test cases in
infraenv_admission_hook_test.go to cover empty-string edge cases for
CpuArchitecture: add cases where oldSpec.CpuArchitecture == "" and newSpec is
models.ClusterCPUArchitectureX8664 (expectedAllowed true if treated as default)
and where oldSpec.CpuArchitecture == "" and newSpec is
models.ClusterCPUArchitectureArm64 (expectedAllowed false if disallowed), and a
case where oldSpec has models.ClusterCPUArchitectureX8664 and
newSpec.CpuArchitecture == "" (expectedAllowed false if clearing is disallowed);
ensure these new entries are added to the same test cases slice used by the Test
InfraEnv admission logic (the table that iterates over name, newSpec, oldSpec,
operation, expectedAllowed) and use admissionv1.Update for operation so they run
alongside the existing CpuArchitecture immutability tests.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6450f9f4-e4fb-458d-b6e6-ae2658c0552b

📥 Commits

Reviewing files that changed from the base of the PR and between f1cf688 and cd8f58e.

📒 Files selected for processing (3)
  • docs/user-guide/multiarch-and-heterogeneous-openshift.md
  • pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook.go
  • pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook_test.go

Comment thread pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook.go Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.37%. Comparing base (0292c41) to head (b0d0273).
⚠️ Report is 42 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9999      +/-   ##
==========================================
+ Coverage   44.09%   45.37%   +1.28%     
==========================================
  Files         415      416       +1     
  Lines       72258    74606    +2348     
==========================================
+ Hits        31860    33853    +1993     
- Misses      37518    37808     +290     
- Partials     2880     2945      +65     
Files with missing lines Coverage Δ
...ks/agentinstall/v1beta1/infraenv_admission_hook.go 81.86% <100.00%> (+1.62%) ⬆️

... and 17 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 11, 2026

@bluesort: This pull request references MGMT-23060 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Changing Spec.CpuArchitecture after InfraEnv creation didn't regenerate boot artifacts, causing download links to point to the wrong architecture (e.g., links still pointed to x86_64 after changing to s390x). This fix makes Spec.CpuArchitecture immutable by adding webhook validation that rejects any attempts to modify the field after creation, preventing the inconsistent state.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Summary by CodeRabbit

  • Documentation

  • Clarified that CPU architecture is immutable after InfraEnv creation; to change it you must delete and recreate the InfraEnv.

  • Bug Fixes

  • Enforced immutability: updates that attempt to change CPU architecture are now rejected with a clear error.

  • Tests

  • Added tests covering allowed and disallowed CPU architecture update scenarios.

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.

@bluesort
Copy link
Copy Markdown
Member Author

/test edge-e2e-ai-operator-ztp

@bluesort
Copy link
Copy Markdown
Member Author

/test edge-subsystem-kubeapi-aws

@openshift-ci openshift-ci Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 16, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 16, 2026

@bluesort: This pull request references MGMT-23060 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Changing Spec.CpuArchitecture after InfraEnv creation didn't regenerate boot artifacts, causing download links to point to the wrong architecture (e.g., links still pointed to x86_64 after changing to s390x). This fix makes Spec.CpuArchitecture immutable by adding webhook validation that rejects any attempts to modify the field after creation, preventing the inconsistent state.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
internal/controller/controllers/bmh_agent_controller.go (1)

1561-1579: Return a composite not-found error here.

When every lookup misses, this bubbles up only the last NotFound, which points operators at the Hypershift fallback even on standard clusters. Returning one error that lists the attempted sources would make this path much easier to debug.

Possible adjustment
 	var err error
+	attempted := make([]string, 0, len(sources))
 	for _, src := range sources {
+		attempted = append(attempted, fmt.Sprintf("%s/%s", src.namespace, src.name))
 		key := types.NamespacedName{
 			Namespace: src.namespace,
 			Name:      src.name,
 		}
 		if err = spokeClient.Get(ctx, key, configMap); err == nil {
 			certData = configMap.Data[src.key]
 			break
 		}
 		// Only try the next source if the configmap doesn't exist.
 		// fail fast on other errors
 		if !k8serrors.IsNotFound(err) {
 			return encodedMCSCrt, ignitionWithMCSCert, err
 		}
 	}
 	if err != nil {
-		return encodedMCSCrt, ignitionWithMCSCert, err
+		return encodedMCSCrt, ignitionWithMCSCert,
+			errors.Errorf("failed to find CA bundle; tried %s: %v", strings.Join(attempted, ", "), err)
 	}

As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/controller/controllers/bmh_agent_controller.go` around lines 1561 -
1579, The loop over sources using spokeClient.Get (building types.NamespacedName
from src.namespace/src.name) currently returns only the last NotFound error;
instead, when no source yields certData, build and return a composite NotFound
error that lists all attempted sources (namespace/name and key) to aid
debugging. Modify the post-loop error handling around configMap and
k8serrors.IsNotFound: collect attempted source identifiers during iteration, and
if err is NotFound for all, construct a single descriptive error (e.g.,
"configmap not found in any of: ns1/name1:key, ns2/name2:key") and return that
together with encodedMCSCrt and ignitionWithMCSCert; preserve the existing
fast-fail behavior for non-NotFound errors from spokeClient.Get.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@internal/controller/controllers/bmh_agent_controller.go`:
- Around line 1561-1579: The loop over sources using spokeClient.Get (building
types.NamespacedName from src.namespace/src.name) currently returns only the
last NotFound error; instead, when no source yields certData, build and return a
composite NotFound error that lists all attempted sources (namespace/name and
key) to aid debugging. Modify the post-loop error handling around configMap and
k8serrors.IsNotFound: collect attempted source identifiers during iteration, and
if err is NotFound for all, construct a single descriptive error (e.g.,
"configmap not found in any of: ns1/name1:key, ns2/name2:key") and return that
together with encodedMCSCrt and ignitionWithMCSCert; preserve the existing
fast-fail behavior for non-NotFound errors from spokeClient.Get.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 717f927e-39fa-4445-9382-c90a0be5ae93

📥 Commits

Reviewing files that changed from the base of the PR and between 0e08e72 and 9149a4f.

📒 Files selected for processing (7)
  • .dockerignore
  • .gitignore
  • data/default_release_images.json
  • deploy/podman/configmap.yml
  • internal/controller/controllers/bmh_agent_controller.go
  • internal/controller/controllers/bmh_agent_controller_test.go
  • openshift/template.yaml
✅ Files skipped from review due to trivial changes (2)
  • deploy/podman/configmap.yml
  • openshift/template.yaml

@openshift-ci openshift-ci Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 16, 2026
Copy link
Copy Markdown
Contributor

@eliorerz eliorerz left a comment

Choose a reason for hiding this comment

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

Great work!
I would consider also merge your commits into single commit with proper details about the solution.

Comment thread pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook.go Outdated
Comment thread pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook_test.go
Comment thread pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook.go Outdated
@openshift-ci openshift-ci Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 20, 2026
@openshift-ci openshift-ci Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 20, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 26, 2026

@gamli75: Overrode contexts on behalf of gamli75: ci/prow/e2e-agent-compact-ipv4-iso-no-registry

Details

In response to this:

/override ci/prow/e2e-agent-compact-ipv4-iso-no-registry

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.

Copy link
Copy Markdown
Contributor

@eliorerz eliorerz left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Mar 26, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 26, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bluesort, eliorerz

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

The pull request process is described 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

@eliorerz
Copy link
Copy Markdown
Contributor

/override ci/prow/edge-e2e-ai-operator-ztp

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 26, 2026

@eliorerz: Overrode contexts on behalf of eliorerz: ci/prow/edge-e2e-ai-operator-ztp

Details

In response to this:

/override ci/prow/edge-e2e-ai-operator-ztp

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

/retest-required

Remaining retests: 0 against base HEAD 7503bc0 and 2 for PR HEAD b0d0273 in total

@openshift-ci-robot
Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD acc8646 and 1 for PR HEAD b0d0273 in total

@bluesort
Copy link
Copy Markdown
Member Author

/override ci/prow/e2e-agent-compact-ipv4-iso-no-registry

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 27, 2026

@bluesort: Overrode contexts on behalf of bluesort: ci/prow/e2e-agent-compact-ipv4-iso-no-registry

Details

In response to this:

/override ci/prow/e2e-agent-compact-ipv4-iso-no-registry

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.

@bluesort
Copy link
Copy Markdown
Member Author

/override ci/prow/e2e-agent-compact-ipv4

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 27, 2026

@bluesort: Overrode contexts on behalf of bluesort: ci/prow/e2e-agent-compact-ipv4

Details

In response to this:

/override ci/prow/e2e-agent-compact-ipv4

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

/retest-required

Remaining retests: 0 against base HEAD d59c041 and 0 for PR HEAD b0d0273 in total

@openshift-ci-robot
Copy link
Copy Markdown

/hold

Revision b0d0273 was retested 3 times: holding

@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 Mar 28, 2026
@gamli75
Copy link
Copy Markdown
Contributor

gamli75 commented Mar 29, 2026

/test edge-subsystem-kubeapi-aws

@bluesort
Copy link
Copy Markdown
Member Author

/test edge-subsystem-aws

@bluesort
Copy link
Copy Markdown
Member Author

/override ci/prow/e2e-agent-compact-ipv4

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 30, 2026

@bluesort: Overrode contexts on behalf of bluesort: ci/prow/e2e-agent-compact-ipv4

Details

In response to this:

/override ci/prow/e2e-agent-compact-ipv4

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.

@bluesort
Copy link
Copy Markdown
Member Author

/hold cancel

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 30, 2026
@openshift-ci-robot
Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 86cd2ee and 2 for PR HEAD b0d0273 in total

@openshift-merge-bot openshift-merge-bot Bot merged commit 6446967 into openshift:master Mar 30, 2026
21 of 22 checks passed
@bluesort bluesort deleted the mgmt-23060 branch March 30, 2026 20:12
@bluesort
Copy link
Copy Markdown
Member Author

bluesort commented Apr 1, 2026

/cherry-pick release-ocm-2.16

@bluesort
Copy link
Copy Markdown
Member Author

bluesort commented Apr 1, 2026

/cherry-pick release-ocm-2.15

@openshift-cherrypick-robot
Copy link
Copy Markdown

@bluesort: #9999 failed to apply on top of branch "release-ocm-2.16":

Applying: Make InfraEnv CpuArchitecture immutable after creation
Using index info to reconstruct a base tree...
M	pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook.go
M	pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook_test.go
Auto-merging pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook.go
CONFLICT (content): Merge conflict in pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Make InfraEnv CpuArchitecture immutable after creation

Details

In response to this:

/cherry-pick release-ocm-2.16

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-cherrypick-robot
Copy link
Copy Markdown

@bluesort: #9999 failed to apply on top of branch "release-ocm-2.15":

Applying: Make InfraEnv CpuArchitecture immutable after creation
Using index info to reconstruct a base tree...
M	pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook.go
M	pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook_test.go
Auto-merging pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook.go
CONFLICT (content): Merge conflict in pkg/webhooks/agentinstall/v1beta1/infraenv_admission_hook.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Make InfraEnv CpuArchitecture immutable after creation

Details

In response to this:

/cherry-pick release-ocm-2.15

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.

@bluesort bluesort restored the mgmt-23060 branch April 2, 2026 12:46
@bluesort bluesort deleted the mgmt-23060 branch April 2, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants