crossplane-contrib / provider-jet-rancher

Apache License 2.0
3 stars 4 forks source link

Unable to create a namespace #6

Closed sboschman closed 2 years ago

sboschman commented 2 years ago

What happened?

Created a composition with a namespace.rancher2.rancher.jet.crossplane.io resource. But I am pretty much stuck with the error:

Warning  ComposeResources         26s (x6 over 87s)  defined/compositeresourcedefinition.apiextensions.crossplane.io  cannot apply composed resource: cannot create object: The POST operation against Namespace.rancher2.rancher.jet.crossplane.io could not be completed at this time, please try again.

Looking into the namespace.rancher2... resource might give a clue what is happening here:

$ kubectl get namespaces.v1alpha1.rancher2.rancher.jet.crossplane.io           
NAME         READY   SYNCED   EXTERNAL-NAME   AGE
myns-2l9bk                    myns            55m

Allright, let's see:

$ kubectl get namespaces.v1alpha1.rancher2.rancher.jet.crossplane.io myns-2l9bk
Error from server (NotFound): the server could not find the requested resource (get namespaces.rancher2.rancher.jet.crossplane.io myns-2l9bk)

So... after some digging I found Kubernetes issue 97397. I suspect this is the cause for Crossplane to fail.

How can we reproduce it?

What environment did it happen in?

Crossplane version: 1.8.1 Provider version: 0.1.0

ytsarev commented 2 years ago

@sboschman I've hit the same in another provider https://github.com/kubernetes/kubernetes/issues/97397#issuecomment-1051219217. Resource need to be renamed to something like RancherNamespace and the problem will go away