-
Notifications
You must be signed in to change notification settings - Fork 370
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
Fix RBAC permissions for the Antctl ClusterRole #5166
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, a few minor comments
test/e2e/antctl_test.go
Outdated
// Secret contents to a file. Ideally, we would use a Pod to run antctl commands instead of | ||
// running it from the Node (in that case, the Secret would be mounted to the Pod). | ||
kubeconfigSecretKey := "kubeconfig" | ||
// No need to worrky about deleting the Secret as it is created in the temporary test Namespace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// No need to worrky about deleting the Secret as it is created in the temporary test Namespace. | |
// No need to worry about deleting the Secret as it is created in the temporary test Namespace. |
83210a0
to
8f6c698
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/test-all |
The ClusterRole definition was no longer up-to-date, with some incorrect permissions and some missing permissions. As a consequence, it could not be used to run some antctl commands, such as supportbundle. We fix the permissions and modify the Antctl e2e tests so that they use a Kubeconfig file generated for the antctl ServiceAccount, instead of the admin Kubeconfig file. Hopefully, this will help keep the ClusterRole definition up-to-date in the future. A few other improvements were implemented in that process: * antctl now uses the typed SystemBundle K8s clientset, instead of a raw REST client. This helps define the correct RBAC permissions for antctl. Previous permissions were indeed incorrect as they used the "post" verb (instead of the "create" verb), which is only correct for non-resource endpoints. * supportbundle unit tests now use an in-memory filesystem, to avoid writing test outputs to the local machine. * the antctl ClusterRole is giving access to a few extra endpoints ("/metrics", "/debug/pprof/*") to increse the usefulness of the antctl proxy command. Fixes antrea-io#5136 Signed-off-by: Antonin Bas <[email protected]>
Signed-off-by: Antonin Bas <[email protected]>
Signed-off-by: Antonin Bas <[email protected]>
8f6c698
to
6678d30
Compare
Signed-off-by: Antonin Bas <[email protected]>
c502128
to
793a930
Compare
'~' is not expanded with docker exec Signed-off-by: Antonin Bas <[email protected]>
793a930
to
4ef67d4
Compare
/test-all |
The ClusterRole definition was no longer up-to-date, with some incorrect permissions and some missing permissions. As a consequence, it could not be used to run some antctl commands, such as supportbundle.
We fix the permissions and modify the Antctl e2e tests so that they use a Kubeconfig file generated for the antctl ServiceAccount, instead of the admin Kubeconfig file. Hopefully, this will help keep the ClusterRole definition up-to-date in the future.
A few other improvements were implemented in that process:
Fixes #5136