Skip to content

OTA-1814: fix(alerts): Remove duplicate information in the recommend command#2279

Open
nbottari9 wants to merge 2 commits into
openshift:mainfrom
nbottari9:1814-duplicate-warning
Open

OTA-1814: fix(alerts): Remove duplicate information in the recommend command#2279
nbottari9 wants to merge 2 commits into
openshift:mainfrom
nbottari9:1814-duplicate-warning

Conversation

@nbottari9

@nbottari9 nbottari9 commented Jun 4, 2026

Copy link
Copy Markdown

Context


If the ClusterUpdateAcceptRisks feature gate is enabled on the cluster, the CVO will include alerts in the conditional update risks. The client also checks for alerts, which can cause warnings or info messages to be printed twice.

Description


We can detect if the server (CVO) is already including alerts by checking if Recommended=False in the ClusterVersion conditional updates. If this is set, we know that the feature gate is enabled, therefore the server is checking alerts and we don't need to on the client.

Changes


  • Added an if statement before calling precheck() to check if the server is including alerts
  • shouldSkipClientAlertChecking() - loops over the ConditionalUpdates and checks to see if any of them have Recommended=False. If so, return true to indicate the server IS checking for alerts and we don't need to on the client.
  • TestServerSideAlertRisks test suite - Added new tests to test new functionality

Summary by CodeRabbit

  • Bug Fixes

    • The upgrade recommendation command now detects cluster feature gates and hypershift usage to avoid unnecessary client-side alert/precheck evaluation when update risks are accepted and hypershift is not in use.
  • Tests

    • Added unit tests covering feature-gate and hypershift detection helper behaviors used by the recommendation alert logic.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

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

The alerts function now detects when the ClusterUpdateAcceptRisks feature gate is enabled and hypershift is not in use; under those conditions, it returns early to skip client-side alert evaluation. Two helper functions inspect cluster FeatureGate and Infrastructure state to determine these conditions, and new unit tests validate the helper behavior.

Changes

Conditional alert checking based on feature gates and hypershift

Layer / File(s) Summary
Helper functions and detection tests
pkg/cli/admin/upgrade/recommend/alerts.go, pkg/cli/admin/upgrade/recommend/recommend_test.go
Import OpenShift config API types and feature-gate constants; implement isAcceptRisksEnabled(featureGate, clusterVersion) and isHypershiftEnabled(infrastructure) helpers to inspect feature gate state and cluster topology; add unit tests validating helper behavior with constructed FeatureGate and Infrastructure objects.
Alert function early-return integration
pkg/cli/admin/upgrade/recommend/alerts.go
Fetch cluster FeatureGate and Infrastructure config resources and return nil early when ClusterUpdateAcceptRisks is enabled and hypershift is not enabled, bypassing alert retrieval and parsing.
Non-semantic formatting adjustment
pkg/cli/admin/upgrade/recommend/recommend.go
Line-anchor adjustment near options.Complete return path with no functional change.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 13 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ⚠️ Warning The PR title references removing duplicate information in the recommend command, but the actual implementation detects feature gates and hypershift topology to skip client-side alert checking—a broader optimization than just removing duplicates. Update the title to reflect the actual implementation: 'fix(alerts): Skip client-side alert checking when server handles risks' or similar, as the changes involve feature gate/hypershift detection rather than duplicate removal.
✅ Passed checks (13 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 adds test functions using Go's standard testing package (not Ginkgo), with test names: TestIsAcceptRisksEnabled, TestIsHypershiftEnabled, and TestSortConditionalUpdatesBySemanticVersions. Al...
Test Structure And Quality ✅ Passed The custom check for Ginkgo test quality is not applicable. The PR adds standard Go tests (TestIsAcceptRisksEnabled, TestIsHypershiftEnabled) using the 'testing' package, not Ginkgo framework.
Microshift Test Compatibility ✅ Passed The PR adds only standard Go unit tests (TestIsAcceptRisksEnabled, TestIsHypershiftEnabled), not Ginkgo e2e tests. The check explicitly applies only to Ginkgo e2e tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR adds only standard Go unit tests (TestIsAcceptRisksEnabled, TestIsHypershiftEnabled using *testing.T), not Ginkgo e2e tests. The check applies only to Ginkgo tests (It(), Describe(), etc.), whic...
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only CLI command code (pkg/cli/admin/upgrade/recommend/) with no deployment manifests, operator code, controllers, or scheduling constraints introduced; check applies only to workload s...
Ote Binary Stdout Contract ✅ Passed The PR modifies CLI command code in pkg/cli/admin/upgrade/recommend/, not OTE test binaries. These files are part of the oc CLI tool's recommend subcommand and contain no process-level stdout write...
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests added. PR contains only standard Go unit tests (TestIsAcceptRisksEnabled, TestIsHypershiftEnabled) using testing.T with no external connectivity or IPv4 assumptions.
No-Weak-Crypto ✅ Passed No weak cryptographic algorithms (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB), custom crypto implementations, or non-constant-time secret comparisons found in the pull request files.
Container-Privileges ✅ Passed PR modifies only Go source files in a CLI utility package; contains no Kubernetes manifests, Dockerfile, or container configurations that could trigger container-privileges checks.
No-Sensitive-Data-In-Logs ✅ Passed No new logging statements that expose sensitive data were added. The PR adds feature gate/hypershift detection logic and tests, with no log/print/fmt calls in new code.

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

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci openshift-ci Bot requested review from ardaguclu and ingvagabund June 4, 2026 15:41
Comment thread pkg/cli/admin/upgrade/recommend/recommend.go Outdated

@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/cli/admin/upgrade/recommend/recommend.go`:
- Around line 187-190: The call to o.Client.ConfigV1().FeatureGates().Get(ctx,
"cluster", metav1.GetOptions{}) is ignoring its error return; capture the error
(e.g., err) instead of using `_` and log it with klog.V(4).Infof() (including
context like that the FeatureGate fetch failed) while keeping the existing nil
fallback behavior for featureGate; update the block that references featureGate
and o.Client to handle the captured error and log it appropriately.
🪄 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: 260e5e72-5faa-490c-859c-5290a98e1dc7

📥 Commits

Reviewing files that changed from the base of the PR and between fb98845 and 0a14aba.

📒 Files selected for processing (1)
  • pkg/cli/admin/upgrade/recommend/recommend.go

Comment thread pkg/cli/admin/upgrade/recommend/recommend.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/recommend.go Outdated

@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: 2

🧹 Nitpick comments (1)
pkg/cli/admin/upgrade/recommend/recommend_test.go (1)

34-67: ⚡ Quick win

Expand test coverage with table-driven tests.

These tests only cover the positive cases. Critical edge cases are missing: nil inputs, version mismatches, and feature-not-enabled scenarios. Table-driven tests would improve coverage and align with guidelines.

As per coding guidelines: "Unit tests should use co-located *_test.go files with table-driven tests."

♻️ Proposed table-driven tests
-func TestIsAcceptRisksEnabled(t *testing.T) {
-	featureGate := &configv1.FeatureGate{
-		Status: configv1.FeatureGateStatus{
-			FeatureGates: []configv1.FeatureGateDetails{
-				{
-					Version: "4.22.0",
-					Enabled: []configv1.FeatureGateAttributes{
-						{
-							Name: features.FeatureGateClusterUpdateAcceptRisks,
-						},
-					},
-				},
-			},
-		},
-	}
-
-	result := isAcceptRisksEnabled(featureGate, "4.22.0")
-	if result != true {
-		t.Errorf("ClusterUpdateAcceptRisks feature gate should report as enabled")
-	}
-}
-
-func TestIsHypershiftEnabled(t *testing.T) {
-	infra := &configv1.Infrastructure{
-		Status: configv1.InfrastructureStatus{
-			ControlPlaneTopology: configv1.ExternalTopologyMode,
-		},
-	}
-
-	result := isHypershiftEnabled(infra)
-	if result != true {
-		t.Errorf("Hypershift should report as enabled")
-	}
-}
+func TestIsAcceptRisksEnabled(t *testing.T) {
+	tests := []struct {
+		name           string
+		featureGate    *configv1.FeatureGate
+		clusterVersion string
+		want           bool
+	}{
+		{
+			name:           "nil feature gate",
+			featureGate:    nil,
+			clusterVersion: "4.22.0",
+			want:           false,
+		},
+		{
+			name: "feature gate enabled for matching version",
+			featureGate: &configv1.FeatureGate{
+				Status: configv1.FeatureGateStatus{
+					FeatureGates: []configv1.FeatureGateDetails{
+						{
+							Version: "4.22.0",
+							Enabled: []configv1.FeatureGateAttributes{
+								{Name: features.FeatureGateClusterUpdateAcceptRisks},
+							},
+						},
+					},
+				},
+			},
+			clusterVersion: "4.22.0",
+			want:           true,
+		},
+		{
+			name: "feature gate enabled for different version",
+			featureGate: &configv1.FeatureGate{
+				Status: configv1.FeatureGateStatus{
+					FeatureGates: []configv1.FeatureGateDetails{
+						{
+							Version: "4.21.0",
+							Enabled: []configv1.FeatureGateAttributes{
+								{Name: features.FeatureGateClusterUpdateAcceptRisks},
+							},
+						},
+					},
+				},
+			},
+			clusterVersion: "4.22.0",
+			want:           false,
+		},
+		{
+			name: "feature gate not in enabled list",
+			featureGate: &configv1.FeatureGate{
+				Status: configv1.FeatureGateStatus{
+					FeatureGates: []configv1.FeatureGateDetails{
+						{
+							Version: "4.22.0",
+							Enabled: []configv1.FeatureGateAttributes{
+								{Name: "SomeOtherFeature"},
+							},
+						},
+					},
+				},
+			},
+			clusterVersion: "4.22.0",
+			want:           false,
+		},
+	}
+
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			got := isAcceptRisksEnabled(tt.featureGate, tt.clusterVersion)
+			if got != tt.want {
+				t.Errorf("isAcceptRisksEnabled() = %v, want %v", got, tt.want)
+			}
+		})
+	}
+}
+
+func TestIsHypershiftEnabled(t *testing.T) {
+	tests := []struct {
+		name  string
+		infra *configv1.Infrastructure
+		want  bool
+	}{
+		{
+			name:  "nil infrastructure",
+			infra: nil,
+			want:  false,
+		},
+		{
+			name: "external topology mode (hypershift)",
+			infra: &configv1.Infrastructure{
+				Status: configv1.InfrastructureStatus{
+					ControlPlaneTopology: configv1.ExternalTopologyMode,
+				},
+			},
+			want: true,
+		},
+		{
+			name: "high availability mode",
+			infra: &configv1.Infrastructure{
+				Status: configv1.InfrastructureStatus{
+					ControlPlaneTopology: configv1.HighlyAvailableTopologyMode,
+				},
+			},
+			want: false,
+		},
+		{
+			name: "single replica mode",
+			infra: &configv1.Infrastructure{
+				Status: configv1.InfrastructureStatus{
+					ControlPlaneTopology: configv1.SingleReplicaTopologyMode,
+				},
+			},
+			want: false,
+		},
+	}
+
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			got := isHypershiftEnabled(tt.infra)
+			if got != tt.want {
+				t.Errorf("isHypershiftEnabled() = %v, want %v", got, tt.want)
+			}
+		})
+	}
+}
🤖 Prompt for 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.

In `@pkg/cli/admin/upgrade/recommend/recommend_test.go` around lines 34 - 67,
Refactor the TestIsAcceptRisksEnabled and TestIsHypershiftEnabled test functions
to use table-driven tests instead of single-case tests. The current tests only
cover positive scenarios and miss critical edge cases. For
TestIsAcceptRisksEnabled, add test cases for nil featureGate input, version
mismatches, disabled features, and empty feature gates. For
TestIsHypershiftEnabled, add test cases for nil infra input, different control
plane topology modes, and other edge conditions. Use a table structure with test
case names, input parameters, and expected results, then iterate through the
table to run each scenario.

Source: Coding guidelines

🤖 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/cli/admin/upgrade/recommend/alerts.go`:
- Around line 33-35: The condition checking cv == nil then attempting to
dereference cv.Status.Desired.Version will cause a nil pointer panic because cv
cannot be dereferenced when it is nil. Change the condition from cv == nil to cv
!= nil in the if statement at line 33 to ensure the ClusterVersion object is not
nil before accessing its Status.Desired.Version field in the
isAcceptRisksEnabled function call.
- Around line 27-29: The three API calls FeatureGates().Get(),
Infrastructures().Get(), and ClusterVersions().Get() are silently discarding
their error returns using the blank identifier. Instead of ignoring errors with
_, capture the error return values from each of these Get() calls and handle
them appropriately. Check each error and either log it, return it, or handle the
failure case explicitly so that network issues, RBAC denials, and other failures
are properly distinguished from successful operations rather than being silently
ignored.

---

Nitpick comments:
In `@pkg/cli/admin/upgrade/recommend/recommend_test.go`:
- Around line 34-67: Refactor the TestIsAcceptRisksEnabled and
TestIsHypershiftEnabled test functions to use table-driven tests instead of
single-case tests. The current tests only cover positive scenarios and miss
critical edge cases. For TestIsAcceptRisksEnabled, add test cases for nil
featureGate input, version mismatches, disabled features, and empty feature
gates. For TestIsHypershiftEnabled, add test cases for nil infra input,
different control plane topology modes, and other edge conditions. Use a table
structure with test case names, input parameters, and expected results, then
iterate through the table to run each scenario.
🪄 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: a2529d24-e031-4cd3-ad50-33dc89d0cd7f

📥 Commits

Reviewing files that changed from the base of the PR and between 8b30ec7 and fbe10c8.

📒 Files selected for processing (3)
  • pkg/cli/admin/upgrade/recommend/alerts.go
  • pkg/cli/admin/upgrade/recommend/recommend.go
  • pkg/cli/admin/upgrade/recommend/recommend_test.go

Comment thread pkg/cli/admin/upgrade/recommend/alerts.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/alerts.go Outdated
@nbottari9 nbottari9 force-pushed the 1814-duplicate-warning branch 2 times, most recently from d9a7f2a to 9cb58aa Compare June 15, 2026 15:29
Comment thread pkg/cli/admin/upgrade/recommend/recommend.go
Comment thread pkg/cli/admin/upgrade/recommend/alerts.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/recommend_test.go
Comment thread pkg/cli/admin/upgrade/recommend/recommend_test.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/alerts.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/alerts.go Outdated
@nbottari9 nbottari9 force-pushed the 1814-duplicate-warning branch from b6b3fb2 to 05b6aaa Compare June 16, 2026 19:06

@hongkailiu hongkailiu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe it is pretty close.
Only a few of code refactoring for simplicity.

We are ready to take mock data from a cluster (HowTo is discussed over slack) and add them into examples and see if we do the output correctly.

Comment on lines +26 to +32
skip, err := o.alertsEvaluatedByCVO(ctx)
if err != nil {
klog.Warningf("An error occured while determining if the CVO is evaluating alerts, so the client will check. %v", err)
}
if skip {
return nil, nil
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: check skip only if err==nil.
If err!=nil (i.e., fail to determine if CVO does it already), oc does it anyway.

Suggested change
skip, err := o.alertsEvaluatedByCVO(ctx)
if err != nil {
klog.Warningf("An error occured while determining if the CVO is evaluating alerts, so the client will check. %v", err)
}
if skip {
return nil, nil
}
if skip, err := o.alertsEvaluatedByCVO(ctx); err != nil {
klog.Warningf("An error occured while determining if the CVO is evaluating alerts, so the client will check. %v", err)
} else if skip {
return nil, nil
}

Comment thread pkg/cli/admin/upgrade/recommend/alerts.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/alerts.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/alerts.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/alerts.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/alerts.go Outdated
}{
{
name: "no infrastructure",
expected: false,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: no need to set up zero value explicitly. It applies to other cases too.

Suggested change
expected: false,

Comment thread pkg/cli/admin/upgrade/recommend/recommend_test.go Outdated
@wking

wking commented Jun 18, 2026

Copy link
Copy Markdown
Member

/retitle OTA-1814: fix(alerts): Remove duplicate information in the recommend command

@openshift-ci openshift-ci Bot changed the title fix(alerts): Remove duplicate information in the recommend command OTA-1814: fix(alerts): Remove duplicate information in the recommend command Jun 18, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 18, 2026

Copy link
Copy Markdown

@nbottari9: This pull request references OTA-1814 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 "5.0.0" version, but no target version was set.

Details

In response to this:

Context


If the ClusterUpdateAcceptRisks feature gate is enabled on the cluster, the CVO will include alerts in the conditional update risks. The client also checks for alerts, which can cause warnings or info messages to be printed twice.

Description


We can detect if the server (CVO) is already including alerts by checking if Recommended=False in the ClusterVersion conditional updates. If this is set, we know that the feature gate is enabled, therefore the server is checking alerts and we don't need to on the client.

Changes


  • Added an if statement before calling precheck() to check if the server is including alerts
  • shouldSkipClientAlertChecking() - loops over the ConditionalUpdates and checks to see if any of them have Recommended=False. If so, return true to indicate the server IS checking for alerts and we don't need to on the client.
  • TestServerSideAlertRisks test suite - Added new tests to test new functionality

Summary by CodeRabbit

  • Bug Fixes

  • The upgrade recommendation command now detects cluster feature gates and hypershift usage to avoid unnecessary client-side alert/precheck evaluation when update risks are accepted and hypershift is not in use.

  • Tests

  • Added unit tests covering feature-gate and hypershift detection helper behaviors used by the recommendation alert logic.

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 openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 18, 2026
Comment thread pkg/cli/admin/upgrade/recommend/alerts.go
Comment thread pkg/cli/admin/upgrade/recommend/alerts.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/alerts_test.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/alerts_test.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/alerts_test.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/alerts_test.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/alerts_test.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/mockresources.go
Comment thread pkg/cli/admin/upgrade/recommend/examples_test.go Outdated
Comment thread pkg/cli/admin/upgrade/recommend/examples/5.0.0-cvo-handling-risks-alerts.json Outdated
@@ -0,0 +1,14 @@
Failing=True:

Reason: ClusterOperatorDegraded

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a bit of noise for our test. 🤷

Comment on lines +73 to +74
"examples/5.0.0-cvo-handling-risks-cv.yaml": "1.2.3-not-important",
"examples/5.0.0-cvo-not-handling-risks-cv.yaml": "1.2.3-not-important",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"examples/5.0.0-cvo-handling-risks-cv.yaml": "1.2.3-not-important",
"examples/5.0.0-cvo-not-handling-risks-cv.yaml": "1.2.3-not-important",
"examples/5.0.0-cvo-handling-risks-cv.yaml": "5.0.0-ec.3",
"examples/5.0.0-cvo-not-handling-risks-cv.yaml": "5.0.0-ec.3",

I missed this in the previous rounds.
We will do some clean up manually after UPDATE=TRUE go test.

Then you will find out we need to handle issues that apply to this cluster but which were not included in from

return fmt.Errorf("issues that apply to this cluster but which were not included in --accept: %s", strings.Join(sets.List(unaccepted), ","))

Reason: PodDisruptionBudgetAtLimit
Message: The pod disruption budget is preventing further disruption to pods. https://github.com/openshift/runbooks/blob/master/alerts/cluster-kube-controller-manager-operator/PodDisruptionBudgetAtLimit.md

error: issues that apply to this cluster but which were not included in --accept: ConditionalUpdateRisk,Failing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I expect this to go to the other branch.

if err != nil {
return fmt.Errorf("failed to determine if CVO is checking alerts: %v", err)
}
fmt.Fprintf(o.Out, "Cluster update risks are being handled by the Cluster Version Operator (CVO). Please use `oc adm upgrade accept ...` to accept risks.\n")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps error fits better. What do you think?

Suggested change
fmt.Fprintf(o.Out, "Cluster update risks are being handled by the Cluster Version Operator (CVO). Please use `oc adm upgrade accept ...` to accept risks.\n")
return fmt.Errorf("issues that apply to this cluster and are not accepted. The command `oc adm upgrade accept` can be used to accept them: %s", strings.Join(sets.List(unaccepted), ","))

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not sure, personally I think nothing wrong necessarily occurred in the code, more informing the user they should use the other command.

if err != nil {
return fmt.Errorf("failed to determine if CVO is checking alerts: %v", err)
}
return fmt.Errorf("There are issues that apply to this cluster and have not been accepted. Cluster update risks are being handled by the Cluster Version Operator (CVO). Please use `oc adm upgrade accept ...` to accept them: %s\n", strings.Join(sets.List(issues), ","))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
return fmt.Errorf("There are issues that apply to this cluster and have not been accepted. Cluster update risks are being handled by the Cluster Version Operator (CVO). Please use `oc adm upgrade accept ...` to accept them: %s\n", strings.Join(sets.List(issues), ","))
return fmt.Errorf("There are issues that apply to this cluster and have not been accepted. Cluster update risks are being handled by the Cluster Version Operator (CVO). Please use `oc adm upgrade accept` to accept them if the associated risks are acceptable: %s\n", strings.Join(sets.List(issues), ","))

@nbottari9 nbottari9 force-pushed the 1814-duplicate-warning branch from ef53167 to 4470fbe Compare July 16, 2026 15:20
…recommend` command

Signed-off-by: Nicholas Bottari <nbottari9@gmail.com>
@nbottari9 nbottari9 force-pushed the 1814-duplicate-warning branch from ce17dc8 to ef559e5 Compare July 16, 2026 17:46
Reason: TestAlert
Message: Test alert for updates. https://github.com/openshift/runbooks/tree/master/alerts?runbook=notfound

error: There are issues that apply to this cluster and have not been accepted. `oc adm upgrade accept` can be used to accept them: ConditionalUpdateRisk

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is TestAlert missing here?
We probably need a bigger effort here and it is totally fine if you want to do it with a follow-up pull.

The effort would be working on the calculation of unaccepted when CVO handles the alert risks.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

recommend.go - line 345, should be unaccepted not issues

@openshift-ci

openshift-ci Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@nbottari9: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-images ef559e5 link true /test okd-scos-images

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.

…VO-handling case

Signed-off-by: Nicholas Bottari <nbottari9@gmail.com>
@hongkailiu

Copy link
Copy Markdown
Member

/lgtm

We will fix #2279 (comment) with a follow up.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 16, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-agnostic-ovn-cmd
/test e2e-aws-ovn
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-aws-ovn-upgrade

@openshift-ci

openshift-ci Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hongkailiu, nbottari9

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

1 similar comment
@openshift-ci

openshift-ci Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hongkailiu, nbottari9

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 16, 2026
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants