Bug 1889919
| Summary: | Document correct way to fetch cluster version | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Chris Johnson <cdjohnson> |
| Component: | OLM | Assignee: | Evan Cordell <ecordell> |
| OLM sub component: | OLM | QA Contact: | Jian Zhang <jiazha> |
| Status: | CLOSED NOTABUG | Docs Contact: | |
| Severity: | medium | ||
| Priority: | unspecified | CC: | aos-bugs, jokerman, krizza, wking |
| Version: | 4.6 | Keywords: | Reopened |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-10-21 18:16:04 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
Chris Johnson
2020-10-20 22:39:16 UTC
"the version of OCP that's running" isn't a well-defined thing. Some more discussion in bug 1692670. I'm closing this bug as a dup of that one, but feel free to re-open if you want space to talk specifically about your particular operator/webhook use-case. *** This bug has been marked as a duplicate of bug 1692670 *** We have an operator that will/should not run on OCP <=4.5 (require 4.6 and above because of various reasons... it's tested, it's EUS, has many features we need, etc) and want to support only running OCP >=4.6. We can enforce this limitation multiple ways. 1. We could limit the install of the Operator on 4.5 by splitting the catalogs into two or more. We would need some way of keeping our CatalogSources image references in sync with the OCP version (when OCP is upgraded), which means we also need a way of determining what version OCP is running. 2. We could prevent the operator pod from starting if the OCP version is not valid. We would need a way of determining the OCP version, and this would be a horrible user experience. 3. We could update our WebHook to prevent creating CRs (operands) for the operator, or provide a status message in the CR why it's not valid. We again need a way of determining the OCP version programmatically. In parallel we are working with OLM to see if we can figure out how to encompass arbitrary metadata into the Operator to identify labels that are installable. But this will take time. We need some sort of solution today for all existing 4.x versions of OCP. So, I'm really asking what is the preferred/supported way of programmatically detecting what version of OCP is currently running with the functionality that is in OCP today? > ...require 4.6 and above because of various reasons...
Can't you just test for those dependencies? If they happen to exist on a nominally-4.5 cluster, say, because the cluster is very late in a 4.5 -> 4.6 update, then great :).
After discussing with the OLM team they indicate that minKubeVersion is the proper way to assert a minimum cluster version for operator installation. With respect to anything more fine grained than that then they suggest testing for presence of required APIs and versions on an API by API basis. Paying close attention to the clusterversion object is not an API we intend to support. I'm moving this to the OLM component as they define the patterns here. Without any explicit support for checking OCP cluster version, this doesn't appear to be a bug. Operators should prefer to make decisions on a cluster based purely on a combination of minKubeVersion and, when running, examining what APIs are available on the environment. Closing this as NOTABUG. If a feature like this is truly required and there's some gap here, a feature request should be filed against the component that owns the OpenShift version (so that it can be debated on its merit as something to include in a future version). |