-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Role, RoleBinding, ClusterRole, ClusterRoleBinding handlers are registered with wrong key #1152
Comments
Is there any plan to fix this in a coming release ? |
Yeah, we'll fix this in coming release |
@rohanKanojia - do you know if there was a reason Kubernetes was added to the front of those class names? Just to avoid collision with the Openshift resources? Would this be as simple as renaming them in the kubeschema.json? |
ah, no. I need to check |
@traviswinter :You're right Kubernetes was added in order to avoid collision with Openshift Role Bindings(Since they were implemented before); I think we need to remove prefixes from here to rename it: kubernetes-client/kubernetes-model/cmd/generate/generate.go Lines 196 to 200 in 99cae30
But I'm afraid doing this might break backward compatibility for openshift users. |
Can you just change the getKind() implementations to return the correct string constant instead of the (simple) class name? We are blocked on this bug. |
I've worked around this for now by making renamed copies of the classes and manually registering them. (And no, modifying getKind() was not enough.) |
@rohanKanojia - What do you think we should do here? Any idea on how we can prevent breaking of Openshift backwards compatibility? I was looking into just checking for "Kubernetes"+getKind() in Handler but that could potentially break the OpenShift handlers as well. Going to try and get more familiar with this code (now that I found out how to add the Eclipse key-bindings to IntelliJ :)) so I can be more productive. |
@traviswinter : This is creating lots of confusion among users. I think we should move forward with renaming these classes to their proper names and rename Openshift classes with prefixes( I think this would make more sense). |
+1, makes sense. |
@traviswinter : Would be awesome if you can find time to fix this. You just need to rename classes in |
@rohanKanojia , sure - can take a stab at it this afternoon. Any recommendation for the prefixes? Simply call it "Openshift"+kind? Would this simply trade the issue from Kubernetes to Openshift? Or does Openshift require a different pattern for creating their resources? |
@traviswinter : No, it's the same pattern. It's just that for an Openshift object we read from an openshift vendor directory(in case of RoleBinding |
Looks like the generate.go changes were not enough - changes to kube-schema.json were required as well, or am I doing something wrong? :) The generated classes themselves will need to be changed as well for |
In which version this will be released ? |
@singhania : It would be available in next release i.e 4.1.2 |
Could this be the cause of my Kubernetes RoleBinding fragment not being picked up by the |
kubernetes-client/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/handlers/KubernetesRoleHandler.java
Line 38 in 0f30508
It should be "Role" not "KubernetesRole". Using Class.getSimpleName() returns the class name.
Similar issue in the following classes:
--> RoleBinding; Affected class KubernetesRoleBindingHandler.
--> ClusterRole; Affected class KubernetesClusterRoleHandler.
--> ClusterRoleBinding; Affected class KubernetesClusterRoleBindingHandler.
The text was updated successfully, but these errors were encountered: