Skip to content
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

ClusterRole and ClusterRoleBinding should be NonNamespacedOperation in RbacAPIGroupClient #3155

Closed
rohanKanojia opened this issue May 21, 2021 · 7 comments · Fixed by #3211
Closed
Assignees
Labels
good first issue Easy hack; Good issue for new contributors help wanted

Comments

@rohanKanojia
Copy link
Member

ClusterRole and ClusterRoleBinding are Cluster scoped Kubernetes resources:

 $ kubectl api-resources
NAME                                  SHORTNAMES       APIVERSION                                    NAMESPACED   KIND

clusterrolebindings                                    authorization.openshift.io/v1                 false        ClusterRoleBinding
clusterroles                                           authorization.openshift.io/v1                 false        ClusterRole

But we're right now using MixedOperation for these which also exposes inNamespace method. It doesn't make sense to have this method for a Cluster Scoped resource. We should use NonNamespacedOperation instead.

RbacApiGroupDSL:

MixedOperation<ClusterRole, ClusterRoleList, Resource<ClusterRole>> clusterRoles();
MixedOperation<ClusterRoleBinding, ClusterRoleBindingList, Resource<ClusterRoleBinding>> clusterRoleBindings();

RbacApiGroupClient

@Override
public MixedOperation<ClusterRole, ClusterRoleList, Resource<ClusterRole>> clusterRoles() {
return new ClusterRoleOperationsImpl(httpClient, getConfiguration());
}
@Override
public MixedOperation<ClusterRoleBinding, ClusterRoleBindingList, Resource<ClusterRoleBinding>> clusterRoleBindings() {
return new ClusterRoleBindingOperationsImpl(httpClient, getConfiguration());
}
}

We need to modify clusterRoles() and clusterRoleBindings() to return NonNamespaceOperation instead of MixedOperation

@rohanKanojia rohanKanojia added help wanted good first issue Easy hack; Good issue for new contributors labels May 21, 2021
@MUzairS15
Copy link
Contributor

I would like to try.

@rohanKanojia
Copy link
Member Author

@MUzairS15 : Shall I assign issue to you then?

@sourabhkumar45
Copy link

ready to work on this issue, Assign if possible.

@MUzairS15
Copy link
Contributor

yes sure

@MUzairS15
Copy link
Contributor

How do i check if i had been successfull, running which test can help?

@rohanKanojia
Copy link
Member Author

@MUzairS15 : Are you working on this issue? Running mvn clean install in kubernetes-client/ module might help. Or running mvn clean install -DskipTests on top of the module might help too to make sure you haven't introduced any compilation failures. We have mock tests in kubernetes-tests/ module which you can run. We have also got tests in kubernetes-itests/ module which you can run against a live kubernetes cluster

@rohanKanojia
Copy link
Member Author

@sourabhkumar45 : I've created two more good first issues. Could you please check if you can pick any one of these instead?

#3162
#3163

manusa pushed a commit that referenced this issue Jun 7, 2021
…cedOperation in RbacAPIGroupClient

* Fixes #2526

Updated CHEATSHEET.md
Added example for how to configure okhttp logging-interceptor.

* Updated PR

* Updated changes

* Changed clusterRoleBindings and clusterRoles to return NonNamespace Operation instead of Mixed operation

* Changed clusterRoleBindings and clusterRoles to return NonNamespace Operation instead of Mixed operation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Easy hack; Good issue for new contributors help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants