redhat-cop / openshift-applier

Used to apply OpenShift objects to an OpenShift Cluster
Apache License 2.0
102 stars 62 forks source link

Update precheck to handle OCP4 cli #130

Closed tylerauerbeck closed 5 years ago

tylerauerbeck commented 5 years ago

What does this PR do?

This change allows our pre-checks to pass when using both oc (3.X) and oc (4.X) clients.

How should this be tested?

Take any applier inventory you would like and run it using the 3.X client and the 4.X client. You can run it with the following and there should be a debug message that will tell you what version is has picked up. Currently it is just grabbing the major version from the 4.X client. I wanted to get some feedback on the approach before continuing down the path to grab the minor version.

ansible-playbook -I inventory playbooks/openshift-cluster-seed.yml -vv

This feels a bit like hitting this problem over the head with a regex-hammer. But it at least allows us to move forward without having to tell it to skip any of our checks. We can likely continue to improve on this as we go (and I'd also like to open an issue upstream to see if they intend to continue following the current format or if there's anyway we can try to move them towards a more friendly structure).

Is there a relevant Issue open for this?

Provide a link to any open issues that describe the problem you are solving.

Resolves #117

Who would you like to review this?

cc: @redhat-cop/openshift-applier @pabrahamsson @oybed

tylerauerbeck commented 5 years ago

@oybed Made the changes you mentioned above (yaml). Also verified that the minor version being 1+ doesn't break our version check.