-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GENERAL QUESTION] Is there a clusterversion equivalent for MicroShift? #731
Comments
could be a motivation to make this advertisable via Infrastructure CR. |
Cheers for replying @derekwaynecarr I don't seem to have that CR in my cluster. No hits for Would it be feasible to publish the distribution, something like "clusterType: MicroShift" in the CRD? As a workaround I'm distinguishing between MS + OCP by the presence of ACM related open-cluster-management-agent pods, this is not going to work for me long term though. |
@piyat which behaviors of MicroShift are different from OCP that lead to you needing to "skip some code"? |
Hey @dhellmann - it's a similar thing to the above (some APIs are unavailable). I'm unable to assert which specific cluster I'm in because I can't get |
The normal advice we give is not to look at the version of the platform, but look at the supported versions of APIs. So if you need a Foo CRD at a specific version level, look for that rather than ClusterVersion or the platform configuration APIs. Is that possible in your case? |
Just to clarify - as the ticket summary might be a bit misleading - I'm not actually trying to get the version, but instead the value of I think your response relates to testing which version of (OCP) MicroShift I'm running, but the problem of distinguishing MicroShift vs OpenShift remains the same (unless I've misunderstood what you've said). As the check depends on It would be nice if there was a way to determine MicroShift or OpenShift or K8s by querying a cluster API. |
Like I said, we don't recommend making decisions in code based on the cluster type. It's more reliable to test for the actual feature you need, because then if the APIs supported in MicroShift or OCP change, your code will still work reliably. What feature of OCP do you use that isn't in MicroShift? What logic would be in the different branches of the |
I think this is resolved by #180. |
I'm using MicroShift to test an Operator (in CI) which usually runs in OpenShift. I want to determine whether I'm running in MicroShift or OpenShift and skip some code if I'm in MicroShift. I don't think MicroShift has the config.openshift.io API.
Is there an equivalent to
oc get clusterversion
available to me in MicroShift, or any API I can use to tell my operator "you are in MicroShift".Ideally I want this to be possible in-cluster (i.e. without the microshift cli).
How to reproduce it (as minimally and precisely as possible):
Attempt #1:
Run
oc get clusterversion
in an OpenShift cluster:NAME VERSION AVAILABLE PROGRESSING SINCE STATUS
version 4.9.29 True False 25d Cluster version is 4.9.29
Run
oc get clusterversion
in MicroShift cluster:error: the server doesn't have a resource type "clusterversion"
Attempt #2:
Run
oc cluster-info
Attempt #3:
Run
oc status
Attempt #4:
Run
oc get consoles
Environment:
Microshift version (use
microshift version
):MicroShift Version: 4.8.0-0.microshift-2022-04-20-141053
Base OKD Version: 4.8.0-0.okd-2021-10-10-030117
Hardware configuration:
Running in Docker 1.13.1 on RHEL 7.9
OS (e.g:
cat /etc/os-release
):cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
uname -a
):Linux ip-10-64-58-162.eu-west-1.compute.internal 3.10.0-1160.24.1.el7.x86_64 Init #1 SMP Thu Mar 25 21:21:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Thanks!
The text was updated successfully, but these errors were encountered: