From 05be48f99e61bf2831378ccb2d992bb68fd46f28 Mon Sep 17 00:00:00 2001 From: Nicholas Bottari Date: Wed, 5 Aug 2026 12:49:33 -0400 Subject: [PATCH] test-fixtures: add new test fixture to test `oc adm upgrade recommend --version [VERSION]` correctly filters out both graph- and alert-sourced risks when they're accepted. Signed-off-by: Nicholas Bottari --- ...0.0-accepted-graph-and-alert-risks-cv.yaml | 295 ++++++++++++++++++ ...ted-graph-and-alert-risks-featuregate.yaml | 130 ++++++++ ...-graph-and-alert-risks-infrastructure.yaml | 30 ++ .../5.0.0-accepted-graph-and-alert-risks.json | 1 + ....0.0-accepted-graph-and-alert-risks.output | 15 + ...-alert-risks.show-outdated-releases-output | 10 + ...-and-alert-risks.version-5.0.0-ec.5-output | 7 + .../admin/upgrade/recommend/examples_test.go | 1 + 8 files changed, 489 insertions(+) create mode 100644 pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks-cv.yaml create mode 100644 pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks-featuregate.yaml create mode 100644 pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks-infrastructure.yaml create mode 100644 pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.json create mode 100644 pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.output create mode 100644 pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.show-outdated-releases-output create mode 100644 pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.version-5.0.0-ec.5-output diff --git a/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks-cv.yaml b/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks-cv.yaml new file mode 100644 index 0000000000..1721c180bb --- /dev/null +++ b/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks-cv.yaml @@ -0,0 +1,295 @@ +apiVersion: config.openshift.io/v1 +kind: ClusterVersion +metadata: + creationTimestamp: "2026-08-05T15:28:19Z" + generation: 8 + name: version + resourceVersion: "46866" + uid: 03e8b1df-210a-4911-ae7e-8e28489db8c5 +spec: + channel: risks-always + clusterID: d275ee16-3918-407d-8d56-981eb2ce7ae2 + desiredUpdate: + acceptRisks: + - name: TestAlert + - name: SyntheticRiskA + - name: SyntheticRiskB + - name: SyntheticRiskC + overrides: + - group: config.openshift.io + kind: ClusterImagePolicy + name: openshift + namespace: "" + unmanaged: true + upstream: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph?channel=risks-always&version=5.0.0-ec.2&arch=amd64 +status: + availableUpdates: + - channels: + - risks-always + image: quay.io/openshift-release-dev/ocp-release@sha256:00000000000000000000000000000000000000000000000000000000004c4f28 + url: https://access.redhat.com/errata/RHSA-2024:05100 + version: 5.1.0 + - channels: + - risks-always + image: quay.io/openshift-release-dev/ocp-release@sha256:cc0eae9544d40aadbac7e0ce1a9beb23056faf5e022620a03eaf50a41b118e61 + url: https://access.redhat.com/errata/RHSA-2024:05000 + version: 5.0.0-ec.5 + capabilities: + enabledCapabilities: + - Build + - CSISnapshot + - CloudControllerManager + - CloudCredential + - Console + - DeploymentConfig + - ImageRegistry + - Ingress + - Insights + - MachineAPI + - NodeTuning + - OperatorLifecycleManager + - OperatorLifecycleManagerV1 + - Storage + - baremetal + - marketplace + - openshift-samples + knownCapabilities: + - Build + - CSISnapshot + - CloudControllerManager + - CloudCredential + - Console + - DeploymentConfig + - ImageRegistry + - Ingress + - Insights + - MachineAPI + - NodeTuning + - OperatorLifecycleManager + - OperatorLifecycleManagerV1 + - Storage + - baremetal + - marketplace + - openshift-samples + conditionalUpdateRisks: + - conditions: + - lastTransitionTime: "2026-08-05T16:40:28Z" + message: "" + reason: Match + status: "True" + type: Applies + matchingRules: + - type: Always + message: This is a synthetic risk A that always applies for testing purposes + name: SyntheticRiskA + url: https://docs.openshift.com/synthetic-risk-a + - conditions: + - lastTransitionTime: "2026-08-05T16:40:28Z" + message: "" + reason: Match + status: "True" + type: Applies + matchingRules: + - type: Always + message: This is a synthetic risk B that always applies for testing purposes + name: SyntheticRiskB + url: https://docs.openshift.com/synthetic-risk-b + - conditions: + - lastTransitionTime: "2026-08-05T16:40:28Z" + message: "" + reason: Match + status: "True" + type: Applies + matchingRules: + - type: Always + message: This is a synthetic risk C that always applies for testing purposes + name: SyntheticRiskC + url: https://docs.openshift.com/synthetic-risk-c + - conditions: + - lastTransitionTime: "2026-08-05T16:35:19Z" + message: 'warning alert TestAlert firing, suggesting issues worth investigating + before updating the cluster. Test alert for updates. The alert description + is: Test alert for updates ' + reason: Alert:firing + status: "True" + type: Applies + matchingRules: + - type: Always + message: Test alert for updates. + name: TestAlert + url: https://github.com/openshift/runbooks/tree/master/alerts?runbook=notfound + conditionalUpdates: + - conditions: + - lastTransitionTime: "2026-08-05T16:39:34Z" + message: The update is recommended, because either risk does not apply to this + cluster or it is accepted by cluster admins. + reason: AllExposedRisksAccepted + status: "True" + type: Recommended + release: + channels: + - risks-always + image: quay.io/openshift-release-dev/ocp-release@sha256:00000000000000000000000000000000000000000000000000000000004c4f28 + url: https://access.redhat.com/errata/RHSA-2024:05100 + version: 5.1.0 + riskNames: + - SyntheticRiskA + - SyntheticRiskC + - TestAlert + risks: + - conditions: + - lastTransitionTime: "2026-08-05T16:40:28Z" + message: "" + reason: Match + status: "True" + type: Applies + matchingRules: + - type: Always + message: This is a synthetic risk A that always applies for testing purposes + name: SyntheticRiskA + url: https://docs.openshift.com/synthetic-risk-a + - conditions: + - lastTransitionTime: "2026-08-05T16:40:28Z" + message: "" + reason: Match + status: "True" + type: Applies + matchingRules: + - type: Always + message: This is a synthetic risk C that always applies for testing purposes + name: SyntheticRiskC + url: https://docs.openshift.com/synthetic-risk-c + - conditions: + - lastTransitionTime: "2026-08-05T16:35:19Z" + message: 'warning alert TestAlert firing, suggesting issues worth investigating + before updating the cluster. Test alert for updates. The alert description + is: Test alert for updates ' + reason: Alert:firing + status: "True" + type: Applies + matchingRules: + - type: Always + message: Test alert for updates. + name: TestAlert + url: https://github.com/openshift/runbooks/tree/master/alerts?runbook=notfound + - conditions: + - lastTransitionTime: "2026-08-05T16:39:34Z" + message: The update is recommended, because either risk does not apply to this + cluster or it is accepted by cluster admins. + reason: AllExposedRisksAccepted + status: "True" + type: Recommended + release: + channels: + - risks-always + image: quay.io/openshift-release-dev/ocp-release@sha256:cc0eae9544d40aadbac7e0ce1a9beb23056faf5e022620a03eaf50a41b118e61 + url: https://access.redhat.com/errata/RHSA-2024:05000 + version: 5.0.0-ec.5 + riskNames: + - SyntheticRiskA + - SyntheticRiskB + - TestAlert + risks: + - conditions: + - lastTransitionTime: "2026-08-05T16:40:28Z" + message: "" + reason: Match + status: "True" + type: Applies + matchingRules: + - type: Always + message: This is a synthetic risk A that always applies for testing purposes + name: SyntheticRiskA + url: https://docs.openshift.com/synthetic-risk-a + - conditions: + - lastTransitionTime: "2026-08-05T16:40:28Z" + message: "" + reason: Match + status: "True" + type: Applies + matchingRules: + - type: Always + message: This is a synthetic risk B that always applies for testing purposes + name: SyntheticRiskB + url: https://docs.openshift.com/synthetic-risk-b + - conditions: + - lastTransitionTime: "2026-08-05T16:35:19Z" + message: 'warning alert TestAlert firing, suggesting issues worth investigating + before updating the cluster. Test alert for updates. The alert description + is: Test alert for updates ' + reason: Alert:firing + status: "True" + type: Applies + matchingRules: + - type: Always + message: Test alert for updates. + name: TestAlert + url: https://github.com/openshift/runbooks/tree/master/alerts?runbook=notfound + conditions: + - lastTransitionTime: "2026-08-05T16:33:53Z" + status: "True" + type: RetrievedUpdates + - lastTransitionTime: "2026-08-05T15:29:10Z" + message: |- + Cluster should not be upgraded between minor or major versions for multiple reasons: ClusterVersionOverridesSet,FeatureGates_RestrictedFeatureGates_TechPreviewNoUpgrade + * Disabling ownership via cluster version overrides prevents upgrades between minor or major versions. Please remove overrides before requesting a minor or major version update. + * Cluster operator config-operator should not be upgraded between minor or major versions: FeatureGatesUpgradeable: "TechPreviewNoUpgrade" does not allow updates + reason: MultipleReasons + status: "False" + type: Upgradeable + - lastTransitionTime: "2026-08-05T15:29:10Z" + message: Capabilities match configured spec + reason: AsExpected + status: "False" + type: ImplicitlyEnabledCapabilities + - lastTransitionTime: "2026-08-05T15:29:10Z" + message: Payload loaded version="5.0.0-ec.2" image="registry.build12.ci.openshift.org/ci-ln-6tjdy82/release@sha256:e8f74fa0423f416cdcd6b35a0769765118c0f8ba9d7e0e25517e41c59483c6af" + architecture="amd64" + reason: PayloadLoaded + status: "True" + type: ReleaseAccepted + - lastTransitionTime: "2026-08-05T16:01:24Z" + message: Done applying 5.0.0-ec.2 + status: "True" + type: Available + - lastTransitionTime: "2026-08-05T16:01:24Z" + status: "False" + type: Failing + - lastTransitionTime: "2026-08-05T16:01:24Z" + message: Cluster version is 5.0.0-ec.2 + status: "False" + type: Progressing + - lastTransitionTime: "2026-08-05T15:29:55Z" + message: Disabling ownership via cluster version overrides prevents upgrades between + minor or major versions. Please remove overrides before requesting a minor or + major version update. + reason: ClusterVersionOverridesSet + status: "False" + type: UpgradeableClusterVersionOverrides + - lastTransitionTime: "2026-08-05T15:34:55Z" + message: 'Cluster operator config-operator should not be upgraded between minor + or major versions: FeatureGatesUpgradeable: "TechPreviewNoUpgrade" does not + allow updates' + reason: FeatureGates_RestrictedFeatureGates_TechPreviewNoUpgrade + status: "False" + type: UpgradeableClusterOperators + desired: + channels: + - channel-head + - risks-always + - risks-matching + - risks-nonmatching + - simple + - smoke-test + image: registry.build12.ci.openshift.org/ci-ln-6tjdy82/release@sha256:e8f74fa0423f416cdcd6b35a0769765118c0f8ba9d7e0e25517e41c59483c6af + url: https://access.redhat.com/errata/RHSA-2024:05000 + version: 5.0.0-ec.2 + history: + - completionTime: "2026-08-05T16:01:24Z" + image: registry.build12.ci.openshift.org/ci-ln-6tjdy82/release@sha256:e8f74fa0423f416cdcd6b35a0769765118c0f8ba9d7e0e25517e41c59483c6af + startedTime: "2026-08-05T15:29:10Z" + state: Completed + verified: false + version: 5.0.0-ec.2 + observedGeneration: 6 + versionHash: mjEGHy29YZ4= diff --git a/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks-featuregate.yaml b/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks-featuregate.yaml new file mode 100644 index 0000000000..c763e05f24 --- /dev/null +++ b/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks-featuregate.yaml @@ -0,0 +1,130 @@ +apiVersion: config.openshift.io/v1 +kind: FeatureGate +metadata: + annotations: + include.release.openshift.io/self-managed-high-availability: "true" + creationTimestamp: "2026-08-05T15:28:39Z" + generation: 1 + name: cluster + resourceVersion: "716" + uid: fe4b8ed9-ed09-4b24-990b-996ea8faf4f4 +spec: + featureSet: TechPreviewNoUpgrade +status: + featureGates: + - disabled: + - name: ClientsAllowCBOR + - name: ClusterAPIComputeInstall + - name: ClusterAPIControlPlaneInstall + - name: ClusterAPIInstall + - name: ClusterUpdatePreflight + - name: ConfidentialCluster + - name: EventedPLEG + - name: Example2 + - name: ExternalOIDCExternalClaimsSourcing + - name: ExternalSnapshotMetadata + - name: HyperShiftOnlyDynamicResourceAllocation + - name: MachineAPIMigrationVSphere + - name: MachineAPIOperatorDisableMachineHealthCheckController + - name: MultiArchInstallAzure + - name: NetworkConnect + - name: ProvisioningRequestAvailable + - name: ShortCertRotation + - name: VSphereMultiVCenterDay2 + enabled: + - name: AWSClusterHostedDNS + - name: AWSClusterHostedDNSInstall + - name: AWSDedicatedHosts + - name: AWSDualStackInstall + - name: AWSEuropeanSovereignCloudInstall + - name: AWSServiceLBNetworkSecurityGroup + - name: AdditionalStorageConfig + - name: AutomatedEtcdBackup + - name: AzureClusterHostedDNSInstall + - name: AzureDedicatedHosts + - name: AzureDualStackInstall + - name: AzureMultiDisk + - name: AzureWorkloadIdentity + - name: BootImageSkewEnforcement + - name: BootcNodeManagement + - name: BuildCSIVolumes + - name: CBORServingAndStorage + - name: CRDCompatibilityRequirementOperator + - name: CRIOCredentialProviderConfig + - name: ClientsPreferCBOR + - name: ClusterAPIInstallIBMCloud + - name: ClusterAPIMachineManagement + - name: ClusterAPIMachineManagementAWS + - name: ClusterAPIMachineManagementAzure + - name: ClusterAPIMachineManagementBareMetal + - name: ClusterAPIMachineManagementGCP + - name: ClusterAPIMachineManagementOpenStack + - name: ClusterAPIMachineManagementPowerVS + - name: ClusterAPIMachineManagementVSphere + - name: ClusterMonitoringConfig + - name: ClusterUpdateAcceptRisks + - name: ClusterVersionOperatorConfiguration + - name: ConfigurablePKI + - name: DNSNameResolver + - name: DualReplica + - name: DyanmicServiceEndpointIBMCloud + - name: EVPN + - name: EtcdBackendQuota + - name: EventTTL + - name: Example + - name: ExternalOIDC + - name: ExternalOIDCWithUIDAndExtraClaimMappings + - name: ExternalOIDCWithUpstreamParity + - name: GCPCustomAPIEndpoints + - name: GCPCustomAPIEndpointsInstall + - name: GCPDualStackInstall + - name: GatewayAPIWithoutOLM + - name: ImageModeStatusReporting + - name: ImageStreamImportMode + - name: IngressControllerDynamicConfigurationManager + - name: InsightsConfig + - name: InsightsOnDemandDataGather + - name: IrreconcilableMachineConfig + - name: KMSEncryption + - name: KMSv1 + - name: MachineAPIMigration + - name: MachineAPIMigrationAWS + - name: MachineAPIMigrationOpenStack + - name: ManagedBootImagesCPMS + - name: MaxUnavailableStatefulSet + - name: MetricsCollectionProfiles + - name: MinimumKubeletVersion + - name: MixedCPUsAllocation + - name: MultiDiskSetup + - name: MutableCSINodeAllocatableCount + - name: MutatingAdmissionPolicy + - name: NewOLM + - name: NewOLMBoxCutterRuntime + - name: NewOLMCatalogdAPIV1Metas + - name: NewOLMConfigAPI + - name: NewOLMOwnSingleNamespace + - name: NewOLMPreflightPermissionChecks + - name: NewOLMWebhookProviderOpenshiftServiceCA + - name: NoOverlayMode + - name: NoRegistryClusterInstall + - name: NutanixMultiSubnets + - name: OLMLifecycleAndCompatibility + - name: OSStreams + - name: OVNObservability + - name: OnPremDNSRecords + - name: OpenShiftPodSecurityAdmission + - name: SELinuxMount + - name: ServiceAccountTokenNodeBinding + - name: SignatureStores + - name: SigstoreImageVerification + - name: SigstoreImageVerificationPKI + - name: StoragePerformantSecurityPolicy + - name: TLSAdherence + - name: UpgradeStatus + - name: VSphereConfigurableMaxAllowedBlockVolumesPerNode + - name: VSphereHostVMGroupZonal + - name: VSphereMixedNodeEnv + - name: VSphereMultiDisk + - name: VSphereMultiNetworks + - name: VolumeGroupSnapshot + version: 5.0.0-ec.2 diff --git a/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks-infrastructure.yaml b/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks-infrastructure.yaml new file mode 100644 index 0000000000..92084e8409 --- /dev/null +++ b/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks-infrastructure.yaml @@ -0,0 +1,30 @@ +apiVersion: config.openshift.io/v1 +kind: Infrastructure +metadata: + creationTimestamp: "2026-08-05T15:28:11Z" + generation: 1 + name: cluster + resourceVersion: "582" + uid: b10bdc47-ca7a-4ec8-8daf-4c75a54a11b3 +spec: + cloudConfig: + key: config + name: cloud-provider-config + platformSpec: + type: GCP +status: + apiServerInternalURI: https://api-int.ci-ln-6tjdy82-72292.gcp-2.ci.openshift.org:6443 + apiServerURL: https://api.ci-ln-6tjdy82-72292.gcp-2.ci.openshift.org:6443 + controlPlaneTopology: HighlyAvailable + cpuPartitioning: None + etcdDiscoveryDomain: "" + infrastructureName: ci-ln-6tjdy82-72292-8nrkr + infrastructureTopology: HighlyAvailable + platform: GCP + platformStatus: + gcp: + cloudLoadBalancerConfig: + dnsType: PlatformDefault + projectID: openshift-gce-devel-ci-2 + region: us-central1 + type: GCP diff --git a/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.json b/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.json new file mode 100644 index 0000000000..b80e4f6fe4 --- /dev/null +++ b/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.json @@ -0,0 +1 @@ +{"status":"success","data":{"alerts":[{"labels":{"alertname":"OpenShiftUpdateRiskMightApply","namespace":"openshift-cluster-version","reason":"Alert:firing","risk":"TestAlert","severity":"warning"},"annotations":{"description":"The conditional update risk TestAlert might apply to the cluster because of Alert:firing, and the cluster update to a version exposed to the risk is not recommended. For more information refer to 'oc adm upgrade'.","runbook_url":"https://github.com/openshift/runbooks/blob/master/alerts/cluster-version-operator/OpenShiftUpdateRiskMightApply.md","summary":"The cluster might have been exposed to the conditional update risk for 15 minutes."},"state":"pending","activeAt":"2026-08-05T16:37:45.987948515Z","value":"1e+00","partialResponseStrategy":"WARN"},{"labels":{"alertname":"OpenShiftUpdateRiskMightApply","namespace":"openshift-cluster-version","reason":"Match","risk":"SyntheticRiskA","severity":"warning"},"annotations":{"description":"The conditional update risk SyntheticRiskA might apply to the cluster because of Match, and the cluster update to a version exposed to the risk is not recommended. For more information refer to 'oc adm upgrade'.","runbook_url":"https://github.com/openshift/runbooks/blob/master/alerts/cluster-version-operator/OpenShiftUpdateRiskMightApply.md","summary":"The cluster might have been exposed to the conditional update risk for 15 minutes."},"state":"pending","activeAt":"2026-08-05T16:34:45.987948515Z","value":"1e+00","partialResponseStrategy":"WARN"},{"labels":{"alertname":"OpenShiftUpdateRiskMightApply","namespace":"openshift-cluster-version","reason":"Match","risk":"SyntheticRiskB","severity":"warning"},"annotations":{"description":"The conditional update risk SyntheticRiskB might apply to the cluster because of Match, and the cluster update to a version exposed to the risk is not recommended. For more information refer to 'oc adm upgrade'.","runbook_url":"https://github.com/openshift/runbooks/blob/master/alerts/cluster-version-operator/OpenShiftUpdateRiskMightApply.md","summary":"The cluster might have been exposed to the conditional update risk for 15 minutes."},"state":"pending","activeAt":"2026-08-05T16:34:45.987948515Z","value":"1e+00","partialResponseStrategy":"WARN"},{"labels":{"alertname":"OpenShiftUpdateRiskMightApply","namespace":"openshift-cluster-version","reason":"Match","risk":"SyntheticRiskC","severity":"warning"},"annotations":{"description":"The conditional update risk SyntheticRiskC might apply to the cluster because of Match, and the cluster update to a version exposed to the risk is not recommended. For more information refer to 'oc adm upgrade'.","runbook_url":"https://github.com/openshift/runbooks/blob/master/alerts/cluster-version-operator/OpenShiftUpdateRiskMightApply.md","summary":"The cluster might have been exposed to the conditional update risk for 15 minutes."},"state":"pending","activeAt":"2026-08-05T16:34:45.987948515Z","value":"1e+00","partialResponseStrategy":"WARN"},{"labels":{"alertname":"ClusterNotUpgradeable","condition":"Upgradeable","endpoint":"metrics","name":"version","namespace":"openshift-cluster-version","severity":"info"},"annotations":{"description":"In most cases, you will still be able to apply patch releases. Reason MultipleReasons. For more information refer to 'oc adm upgrade' or https://console-openshift-console.apps.ci-ln-6tjdy82-72292.gcp-2.ci.openshift.org/settings/cluster/.","summary":"One or more cluster operators have been blocking minor or major version cluster updates for at least an hour."},"state":"pending","activeAt":"2026-08-05T15:56:40.669438478Z","value":"0e+00","partialResponseStrategy":"WARN"},{"labels":{"alertname":"UpdateAvailable","channel":"risks-always","namespace":"openshift-cluster-version","severity":"info","upstream":"https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph?channel=risks-always\u0026version=5.0.0-ec.2\u0026arch=amd64"},"annotations":{"description":"For more information refer to 'oc adm upgrade' or https://console-openshift-console.apps.ci-ln-6tjdy82-72292.gcp-2.ci.openshift.org/settings/cluster/.","summary":"Your upstream update recommendation service recommends you update your cluster."},"state":"firing","activeAt":"2026-08-05T16:40:10.741596918Z","value":"2e+00","partialResponseStrategy":"WARN"},{"labels":{"alertname":"InsightsRecommendationActive","container":"insights-operator","description":"Enabling the **TechPreviewNoUpgrade** feature set on your cluster\ncan not be undone and prevents minor version updates. Please do\nnot enable this feature set on production clusters.\n","endpoint":"https","info_link":"https://console.redhat.com/openshift/insights/advisor/clusters/d275ee16-3918-407d-8d56-981eb2ce7ae2?first=ccx_rules_ocp.external.rules.upgrade_is_blocked_due_to_tpfg%7CTECH_PREVIEW_NO_UPGRADE_FEATURE_SET_IS_ENABLED","instance":"10.128.0.14:8443","job":"metrics","namespace":"openshift-insights","pod":"insights-operator-584747df49-dznkz","service":"metrics","severity":"info","total_risk":"Important"},"annotations":{"description":"Insights recommendation \"Enabling the **TechPreviewNoUpgrade** feature set on your cluster\ncan not be undone and prevents minor version updates. Please do\nnot enable this feature set on production clusters.\n\" with total risk \"Important\" was detected on the cluster. More information is available at https://console.redhat.com/openshift/insights/advisor/clusters/d275ee16-3918-407d-8d56-981eb2ce7ae2?first=ccx_rules_ocp.external.rules.upgrade_is_blocked_due_to_tpfg%7CTECH_PREVIEW_NO_UPGRADE_FEATURE_SET_IS_ENABLED.","summary":"An Insights recommendation is active for this cluster."},"state":"firing","activeAt":"2026-08-05T15:56:45.536087262Z","value":"1e+00","partialResponseStrategy":"WARN"},{"labels":{"alertname":"TechPreviewNoUpgrade","container":"kube-apiserver-operator","endpoint":"https","instance":"10.128.0.34:8443","job":"kube-apiserver-operator","name":"TechPreviewNoUpgrade","namespace":"openshift-kube-apiserver-operator","pod":"kube-apiserver-operator-7d998989dd-x9q7g","service":"metrics","severity":"warning"},"annotations":{"description":"Cluster has enabled Technology Preview features that cannot be undone and will prevent upgrades. The TechPreviewNoUpgrade feature set is not recommended on production clusters.","summary":"Cluster has enabled tech preview features that will prevent upgrades."},"state":"firing","activeAt":"2026-08-05T15:57:01.406855878Z","value":"0e+00","partialResponseStrategy":"WARN"},{"labels":{"alertname":"Watchdog","namespace":"openshift-monitoring","severity":"none"},"annotations":{"description":"This is an alert meant to ensure that the entire alerting pipeline is functional.\nThis alert is always firing, therefore it should always be firing in Alertmanager\nand always fire against a receiver. There are integrations with various notification\nmechanisms that send a notification when this alert is not firing. For example the\n\"DeadMansSnitch\" integration in PagerDuty.\n","summary":"An alert that should always be firing to certify that Alertmanager is working properly."},"state":"firing","activeAt":"2026-08-05T15:56:06.311672714Z","value":"1e+00","partialResponseStrategy":"WARN"},{"labels":{"alertname":"TargetDown","job":"check-endpoints","namespace":"openshift-apiserver","service":"check-endpoints","severity":"warning"},"annotations":{"description":"100% of the check-endpoints/check-endpoints targets in openshift-apiserver namespace have been unreachable for more than 15 minutes. This may be a symptom of network connectivity issues, down nodes, or failures within these components. Assess the health of the infrastructure and nodes running these targets and then contact support.","runbook_url":"https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/TargetDown.md","summary":"Some targets were not reachable from the monitoring server for an extended period of time."},"state":"firing","activeAt":"2026-08-05T15:56:40.936046152Z","value":"1e+02","partialResponseStrategy":"WARN"},{"labels":{"alertname":"AlertmanagerReceiversNotConfigured","namespace":"openshift-monitoring","severity":"warning"},"annotations":{"description":"Alerts are not configured to be sent to a notification system, meaning that you may not be notified in a timely fashion when important failures occur. Check the OpenShift documentation to learn how to configure notifications with Alertmanager.","summary":"Receivers (notification integrations) are not configured on Alertmanager"},"state":"firing","activeAt":"2026-08-05T15:56:15.295812914Z","value":"0e+00","partialResponseStrategy":"WARN"},{"labels":{"alertname":"TestAlert","openShiftUpdatePrecheck":"true","severity":"warning"},"annotations":{"description":"Test alert for updates","summary":"Test alert for updates"},"state":"firing","activeAt":"2026-08-05T16:35:19.532828786Z","value":"1e+00","partialResponseStrategy":"WARN"}]}} \ No newline at end of file diff --git a/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.output b/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.output new file mode 100644 index 0000000000..01de91ca83 --- /dev/null +++ b/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.output @@ -0,0 +1,15 @@ +Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph?channel=risks-always&version=5.0.0-ec.2&arch=amd64 +Channel: risks-always (available channels: channel-head, risks-always, risks-matching, risks-nonmatching, simple, smoke-test) + +Updates to 5.1: + + Version: 5.1.0 + Image: quay.io/openshift-release-dev/ocp-release@sha256:00000000000000000000000000000000000000000000000000000000004c4f28 + Reason: MultipleReasons + Message: Cluster should not be upgraded between minor or major versions for multiple reasons: ClusterVersionOverridesSet,FeatureGates_RestrictedFeatureGates_TechPreviewNoUpgrade + * Disabling ownership via cluster version overrides prevents upgrades between minor or major versions. Please remove overrides before requesting a minor or major version update. + * Cluster operator config-operator should not be upgraded between minor or major versions: FeatureGatesUpgradeable: "TechPreviewNoUpgrade" does not allow updates + +Updates to 5.0: + VERSION ISSUES + 5.0.0-ec.5 no known issues relevant to this cluster diff --git a/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.show-outdated-releases-output b/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.show-outdated-releases-output new file mode 100644 index 0000000000..26366a685f --- /dev/null +++ b/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.show-outdated-releases-output @@ -0,0 +1,10 @@ +Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph?channel=risks-always&version=5.0.0-ec.2&arch=amd64 +Channel: risks-always (available channels: channel-head, risks-always, risks-matching, risks-nonmatching, simple, smoke-test) + +Updates to 5.1: + VERSION ISSUES + 5.1.0 MultipleReasons + +Updates to 5.0: + VERSION ISSUES + 5.0.0-ec.5 no known issues relevant to this cluster diff --git a/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.version-5.0.0-ec.5-output b/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.version-5.0.0-ec.5-output new file mode 100644 index 0000000000..187e4cc62e --- /dev/null +++ b/pkg/cli/admin/upgrade/recommend/examples/5.0.0-accepted-graph-and-alert-risks.version-5.0.0-ec.5-output @@ -0,0 +1,7 @@ +Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph?channel=risks-always&version=5.0.0-ec.2&arch=amd64 +Channel: risks-always (available channels: channel-head, risks-always, risks-matching, risks-nonmatching, simple, smoke-test) + +Update to 5.0.0-ec.5 has no known issues relevant to this cluster. +Image: quay.io/openshift-release-dev/ocp-release@sha256:cc0eae9544d40aadbac7e0ce1a9beb23056faf5e022620a03eaf50a41b118e61 +Release URL: https://access.redhat.com/errata/RHSA-2024:05000 +Update to 5.0.0-ec.5 has no known issues relevant to this cluster other than the accepted SyntheticRiskA,SyntheticRiskB,SyntheticRiskC,TestAlert. diff --git a/pkg/cli/admin/upgrade/recommend/examples_test.go b/pkg/cli/admin/upgrade/recommend/examples_test.go index 4ebf9f8057..15ac06c95f 100644 --- a/pkg/cli/admin/upgrade/recommend/examples_test.go +++ b/pkg/cli/admin/upgrade/recommend/examples_test.go @@ -72,6 +72,7 @@ func TestExamples(t *testing.T) { "examples/4.22.0-extend-recommended-critical-alert-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", + "examples/5.0.0-accepted-graph-and-alert-risks-cv.yaml": "5.0.0-ec.5", }, outputSuffixPattern: ".version-%s-output", },