Bug 2018368
| Summary: | Cluster-version operator should account for reporting ClusterOperator version in Upgradeable comparison | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | W. Trevor King <wking> |
| Component: | Cluster Version Operator | Assignee: | Lalatendu Mohanty <lmohanty> |
| Status: | CLOSED DEFERRED | QA Contact: | Yang Yang <yanyang> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 4.6 | CC: | lmohanty, yanyang |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-03-09 01:08:30 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
W. Trevor King
2021-10-29 03:17:35 UTC
Poking around a bit more:
$ oc get -o jsonpath='{.status.desired.version}{"\n"}' clusterversion version
4.7.35
$ oc adm upgrade channel candidate-4.8 # requires oc from 4.9+
$ cat <<EOF >co.yaml
apiVersion: config.openshift.io/v1
kind: ClusterOperator
metadata:
name: testing
spec: {}
EOF
$ oc apply -f co.yaml
$ oc proxy &
$ curl -k -XPATCH -H "Accept: application/json" -H "Content-Type: application/json-patch+json" 'http://127.0.0.1:8001/apis/config.openshift.io/v1/clusteroperators/testing/status' -d '[{"op": "add", "path": "/status", "value": {"conditions": [{"lastTransitionTime": "2021-06-01T01:01:01Z", "type": "Upgradeable", "status": "False", "reason": "Testing", "message": "The whatsits are broken."}]}}]'
$ killall oc
$ wait
$ oc wait --for=condition=Upgradeable=False clusterversion/version
$ oc adm upgrade --to 4.8.18
$ oc get -o json clusterversion version | jq '.status | {desired, history}'
{
"desired": {
"channels": [
"candidate-4.8",
"candidate-4.9"
],
"image": "quay.io/openshift-release-dev/ocp-release@sha256:321aae3d3748c589bc2011062cee9fd14e106f258807dc2d84ced3f7461160ea",
"url": "https://access.redhat.com/errata/RHBA-2021:4020",
"version": "4.8.18"
},
"history": [
{
"completionTime": null,
"image": "quay.io/openshift-release-dev/ocp-release@sha256:321aae3d3748c589bc2011062cee9fd14e106f258807dc2d84ced3f7461160ea",
"startedTime": "2021-10-29T18:02:53Z",
"state": "Partial",
"verified": true,
"version": "4.8.18"
},
{
"completionTime": "2021-10-29T17:09:20Z",
"image": "registry.build01.ci.openshift.org/ci-ln-1si4qlk/release@sha256:fc8ceaa410c3903f249a071cb3bf4a5bc1523fc16d7cdaf0e0c3384bf08ec622",
"startedTime": "2021-10-29T16:45:08Z",
"state": "Completed",
"verified": false,
"version": "4.7.35"
}
]
}
Instead of adjusting our ClusterOperator consumption, we could adjust our ClusterVersion handling to only set desired after we'd accepted the update (instead of setting it while we were still considering preconditions). Then we could use that desired value as a sign of our jumping-off place in our Upgradeable precondition, instead of the most-recently-completed version. For example, in the 4.7.34 (completed) -> 4.8.17 (partial) -> 4.8.18 case, it would treat 4.8.17 as the jumping off point for the 4.8.18 retarget. That may or may not match the versions of the feeding ClusterOperator, but really, the point would be "this is accepting a patch retarget of an already-accepted 4.y minor". And we want bug 1802553 to protect us from retargets adding an additional minor-bump on top of an existing partial minor-bump. And that avoids any need for component operators to get the fiddly status.versions[name=operator] guards I'd floated in comment 0 right.
Reducing the severity of the bug as this bug has been around for some time and we have not not heard many complains about the issue. OpenShift has moved to Jira for its defect tracking! This bug can now be found in the OCPBUGS project in Jira. https://issues.redhat.com/browse/OCPBUGS-9013 |