tnozicka / openshift-acme

ACME Controller for OpenShift and Kubernetes Cluster. (Supports e.g. Let's Encrypt)
Apache License 2.0
319 stars 116 forks source link

apiVersions for OpenShift 4.0 and higher #93

Closed jkremser closed 5 years ago

jkremser commented 5 years ago

In OCP 4.0 and since a corresponding version of K8s the apiVersions of image stream and cluster role have changed.

for image streams, it's: v1 -> image.openshift.io/v1

for cluster role, it's: v1 -> rbac.authorization.k8s.io/v1

Otherwise the creation of those resources fail with:

error: unable to recognize "https://raw.githubusercontent.com/tnozicka/openshift-acme/master/deploy/letsencrypt-live/cluster-wide/imagestream.yaml": no matches for /, Kind=ImageStream
tnozicka commented 5 years ago

/assign tnozicka

tnozicka commented 5 years ago

Interesting, I know the deprecated legacy (non groupified) API got dropped in 4.x but we were running our CI against 4.0 and today I have tried running the CI with OCP 4.1 and 4.2 and it still got over the resource creation https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/openshift_release/4245/rehearse-4245-pull-ci-tnozicka-openshift-acme-master-e2e-cluster-wide/2 clusterrole.rbac.authorization.k8s.io/openshift-acme added: "openshift-acme"

so I wonder maybe you have an older oc client? maybe the new one automatically converts those to new resources.

I have a fix in https://github.com/tnozicka/openshift-acme/pull/97 but I was hoping to see it first fail against OCP 4.x so I could verify it fixes the issue.

jkremser commented 5 years ago

yes, the obsolete oc client may have been the cause, I bumped later on to similar issue (on different domain) and using the 4.x client worked. It's weird though, I always though the client is pretty dumb when it comes to API and doing some magic under the cover w/ the payloads.

tnozicka commented 5 years ago

yeah, apparently that was the middle ground for removing legacy /oapi

https://github.com/openshift/origin/blob/f2220f0aaae3f7ef1919efe657fb96cd5d4c3aff/vendor/github.com/openshift/library-go/pkg/legacyapi/legacygroupification/groupification.go#L150

https://github.com/openshift/origin/blob/efc7e25e7d1475b7c0c6caa74093cdad64d467e9/vendor/k8s.io/kubernetes/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/openshiftpatch/patch_openshift.go#L12