OTA-1959: oc adm upgrade recommend works with accepted risks - #2370
OTA-1959: oc adm upgrade recommend works with accepted risks#2370hongkailiu wants to merge 1 commit into
Conversation
> launch 5.0.0-ec.2 gcp,techpreview
```console
$ TOKEN="$(oc -n openshift-cluster-version exec deployment/cluster-version-operator -- cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
$ TESTCASE="5.0.0-includes-graph-and-alert-risks-accept"
$ OC_ENABLE_CMD_INSPECT_ALERTS=true oc --token "${TOKEN}" adm inspect-alerts | jq > ${TESTCASE}-alerts.json
$ get infrastructure cluster -o yaml > ${TESTCASE}-infrastructure.yaml
$ oc get featuregate cluster -o yaml > ${TESTCASE}--featuregate.yaml
$ oc get clusterversion version -o yaml > ${TESTCASE}-cv.yaml
```
The `yaml` and `json` input files above are taken after `OC_ENABLE_CMD_UPGRADE_ACCEPT_RISKS=true ./oc adm upgrade accept TestAlertB,SyntheticRiskB` in the following testing which fits more into an e2e test case. We can come back to it if needed in the future.
```console
$ oc patch clusterversion/version --patch '{"spec":{"upstream":"https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph"}}' --type=merge
$ oc adm upgrade channel risks-always
$ oc apply -f /tmp/alert.yaml
prometheusrule.monitoring.coreos.com/test-update-alert created
$ cat /tmp/alert.yaml
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: test-update-alert
namespace: openshift-monitoring
spec:
groups:
- name: testA
rules:
- alert: TestAlertA
expr: vector(1)
labels:
severity: warning
openShiftUpdatePrecheck: "true"
annotations:
summary: "Test alert aaa for updates"
description: "Test alert aaa for updates"
- name: testB
rules:
- alert: TestAlertB
expr: vector(1)
labels:
severity: warning
openShiftUpdatePrecheck: "true"
annotations:
summary: "Test alert bbb for updates"
description: "Test alert bbb for updates"
$ ./oc adm upgrade recommend --version 5.0.0-ec.5
Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph
Channel: risks-always (available channels: channel-head, risks-always, risks-matching, risks-nonmatching, simple, smoke-test)
Update to 5.0.0-ec.5 Recommended=False:
Image: quay.io/openshift-release-dev/ocp-release@sha256:cc0eae9544d40aadbac7e0ce1a9beb23056faf5e022620a03eaf50a41b118e61
Release URL: https://access.redhat.com/errata/RHSA-2024:05000
Reason: MultipleReasons
Message: This is a synthetic risk A that always applies for testing purposes https://docs.openshift.com/synthetic-risk-a
This is a synthetic risk B that always applies for testing purposes https://docs.openshift.com/synthetic-risk-b
Test alert aaa for updates. https://github.com/openshift/runbooks/tree/master/alerts?runbook=notfound
Test alert bbb 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: SyntheticRiskA,SyntheticRiskB,TestAlertA,TestAlertB
$ ./oc adm upgrade recommend --version 5.1.0
Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph
Channel: risks-always (available channels: channel-head, risks-always, risks-matching, risks-nonmatching, simple, smoke-test)
Update to 5.1.0 Recommended=False:
Image: quay.io/openshift-release-dev/ocp-release@sha256:00000000000000000000000000000000000000000000000000000000004c4f28
Release URL: https://access.redhat.com/errata/RHSA-2024:05100
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
This is a synthetic risk A that always applies for testing purposes https://docs.openshift.com/synthetic-risk-a
This is a synthetic risk C that always applies for testing purposes https://docs.openshift.com/synthetic-risk-c
Test alert aaa for updates. https://github.com/openshift/runbooks/tree/master/alerts?runbook=notfound
Test alert bbb 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: SyntheticRiskA,SyntheticRiskC,TestAlertA,TestAlertB
$ ./oc adm upgrade recommend
Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph
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
This is a synthetic risk A that always applies for testing purposes https://docs.openshift.com/synthetic-risk-a
This is a synthetic risk C that always applies for testing purposes https://docs.openshift.com/synthetic-risk-c
Test alert aaa for updates. https://github.com/openshift/runbooks/tree/master/alerts?runbook=notfound
Test alert bbb for updates. https://github.com/openshift/runbooks/tree/master/alerts?runbook=notfound
Updates to 5.0:
Version: 5.0.0-ec.5
Image: quay.io/openshift-release-dev/ocp-release@sha256:cc0eae9544d40aadbac7e0ce1a9beb23056faf5e022620a03eaf50a41b118e61
Reason: MultipleReasons
Message: This is a synthetic risk A that always applies for testing purposes https://docs.openshift.com/synthetic-risk-a
This is a synthetic risk B that always applies for testing purposes https://docs.openshift.com/synthetic-risk-b
Test alert aaa for updates. https://github.com/openshift/runbooks/tree/master/alerts?runbook=notfound
Test alert bbb for updates. https://github.com/openshift/runbooks/tree/master/alerts?runbook=notfound
$ OC_ENABLE_CMD_UPGRADE_ACCEPT_RISKS=true ./oc adm upgrade accept TestAlertB,SyntheticRiskB
info: Accept risks are [SyntheticRiskB, TestAlertB]
$ ./oc adm upgrade recommend
Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph
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
This is a synthetic risk A that always applies for testing purposes https://docs.openshift.com/synthetic-risk-a
This is a synthetic risk C that always applies for testing purposes https://docs.openshift.com/synthetic-risk-c
Test alert aaa for updates. https://github.com/openshift/runbooks/tree/master/alerts?runbook=notfound
Updates to 5.0:
Version: 5.0.0-ec.5
Image: quay.io/openshift-release-dev/ocp-release@sha256:cc0eae9544d40aadbac7e0ce1a9beb23056faf5e022620a03eaf50a41b118e61
Reason: MultipleReasons
Message: This is a synthetic risk A that always applies for testing purposes https://docs.openshift.com/synthetic-risk-a
Test alert aaa for updates. https://github.com/openshift/runbooks/tree/master/alerts?runbook=notfound
$ ./oc adm upgrade recommend --version 5.0.0-ec.5
Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph
Channel: risks-always (available channels: channel-head, risks-always, risks-matching, risks-nonmatching, simple, smoke-test)
Update to 5.0.0-ec.5 Recommended=False:
Image: quay.io/openshift-release-dev/ocp-release@sha256:cc0eae9544d40aadbac7e0ce1a9beb23056faf5e022620a03eaf50a41b118e61
Release URL: https://access.redhat.com/errata/RHSA-2024:05000
Reason: MultipleReasons
Message: This is a synthetic risk A that always applies for testing purposes https://docs.openshift.com/synthetic-risk-a
Test alert aaa 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: SyntheticRiskA,TestAlertA
$ ./oc adm upgrade recommend --version 5.1.0
Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph
Channel: risks-always (available channels: channel-head, risks-always, risks-matching, risks-nonmatching, simple, smoke-test)
Update to 5.1.0 Recommended=False:
Image: quay.io/openshift-release-dev/ocp-release@sha256:00000000000000000000000000000000000000000000000000000000004c4f28
Release URL: https://access.redhat.com/errata/RHSA-2024:05100
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
This is a synthetic risk A that always applies for testing purposes https://docs.openshift.com/synthetic-risk-a
This is a synthetic risk C that always applies for testing purposes https://docs.openshift.com/synthetic-risk-c
Test alert aaa 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: SyntheticRiskA,SyntheticRiskC,TestAlertA
$ OC_ENABLE_CMD_UPGRADE_ACCEPT_RISKS=true ./oc adm upgrade accept TestAlertB,TestAlertA,SyntheticRiskB,SyntheticRiskA
info: Accept risks are [SyntheticRiskB, TestAlertB, SyntheticRiskA, TestAlertA]
$ ./oc adm upgrade recommend
Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph
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
This is a synthetic risk C that always applies for testing purposes https://docs.openshift.com/synthetic-risk-c
Updates to 5.0:
VERSION ISSUES
5.0.0-ec.5 no known issues relevant to this cluster
$ ./oc adm upgrade recommend --version 5.0.0-ec.5
Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph
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,TestAlertA,TestAlertB.
$ ./oc adm upgrade recommend --version 5.1.0
Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph
Channel: risks-always (available channels: channel-head, risks-always, risks-matching, risks-nonmatching, simple, smoke-test)
Update to 5.1.0 Recommended=False:
Image: quay.io/openshift-release-dev/ocp-release@sha256:00000000000000000000000000000000000000000000000000000000004c4f28
Release URL: https://access.redhat.com/errata/RHSA-2024:05100
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
This is a synthetic risk C that always applies for testing purposes https://docs.openshift.com/synthetic-risk-c
error: There are issues that apply to this cluster and have not been accepted. `oc adm upgrade accept` can be used to accept them: SyntheticRiskC
$ OC_ENABLE_CMD_UPGRADE_ACCEPT_RISKS=true ./oc adm upgrade accept TestAlertB,TestAlertA,SyntheticRiskB,SyntheticRiskA,SyntheticRiskC
info: Accept risks are [SyntheticRiskB, TestAlertB, SyntheticRiskA, TestAlertA, SyntheticRiskC]
$ ./oc adm upgrade recommend
Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph
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
$ ./oc adm upgrade recommend --version 5.0.0-ec.5
Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph
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,TestAlertA,TestAlertB.
➜ oc git:(o-main) ./oc adm upgrade recommend --version 5.1.0
Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph
Channel: risks-always (available channels: channel-head, risks-always, risks-matching, risks-nonmatching, simple, smoke-test)
Update to 5.1.0 Recommended=False:
Image: quay.io/openshift-release-dev/ocp-release@sha256:00000000000000000000000000000000000000000000000000000000004c4f28
Release URL: https://access.redhat.com/errata/RHSA-2024:05100
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
Update to 5.1.0 has no known issues relevant to this cluster other than the accepted SyntheticRiskA,SyntheticRiskC,TestAlertA,TestAlertB.
$ OC_ENABLE_CMD_UPGRADE_ACCEPT_RISKS=true ./oc adm upgrade accept TestAlertB-,SyntheticRiskB-
info: Accept risks are [SyntheticRiskA, TestAlertA, SyntheticRiskC]
$ ./oc adm upgrade recommend
Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph
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
Test alert bbb for updates. https://github.com/openshift/runbooks/tree/master/alerts?runbook=notfound
Updates to 5.0:
Version: 5.0.0-ec.5
Image: quay.io/openshift-release-dev/ocp-release@sha256:cc0eae9544d40aadbac7e0ce1a9beb23056faf5e022620a03eaf50a41b118e61
Reason: MultipleReasons
Message: This is a synthetic risk B that always applies for testing purposes https://docs.openshift.com/synthetic-risk-b
Test alert bbb for updates. https://github.com/openshift/runbooks/tree/master/alerts?runbook=notfound
$ OC_ENABLE_CMD_UPGRADE_ACCEPT_RISKS=true ./oc adm upgrade accept --clear
info: Accept risks are []
```
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@hongkailiu: This pull request references OTA-1959 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 story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
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. |
|
@hongkailiu: GitHub didn't allow me to assign the following users: nbottari9. Note that only openshift members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. DetailsIn response to this:
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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hongkailiu The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (8)
WalkthroughAdds fixtures for an upgrade recommendation scenario with graph risks, firing alerts, accepted risks, cluster state, expected command output, and specific-version test registration. ChangesUpgrade risk fixture scenario
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 11❌ Failed checks (1 warning, 10 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 14 UNAVAILABLE: read ECONNRESET Comment |
|
@hongkailiu: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
This pull replaces #2355
/assign @nbottari9
The
yamlandjsoninput files above are taken afterOC_ENABLE_CMD_UPGRADE_ACCEPT_RISKS=true ./oc adm upgrade accept TestAlertB,SyntheticRiskBin the following testing which fits more into an e2e test case. We can come back to it if needed in the future.To keep the sanity of the repo, we do not push all of the snapshots into the folder. Instead, one of them is taken to show the (likely) most interesting case: some risks are accepted while some not.
Summary by CodeRabbit
5.0.0-ec.5.