-
Notifications
You must be signed in to change notification settings - Fork 182
feat(kubernetes)!: simplified Kubernetes client access for toolsets #483
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
Conversation
ed3059a to
11def02
Compare
Cali0707
left a comment
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.
11def02 to
4b07dcc
Compare
c649cc3 to
06c35b0
Compare
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Marc Nuri <marc@marcnuri.com>
2eafcbc to
820cfd2
Compare
| cfg *rest.Config | ||
| kubernetes.Interface | ||
| discoveryClient discovery.CachedDiscoveryInterface | ||
| dynamicClient *dynamic.DynamicClient |
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.
What about using dynamic.Interface to allow mocking with k8s.io/client-go/dynamic/fake in tests?
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.
yup, good catch.
Wanted to switch to interfaces as much as possible, this one remained.
It won't be me who uses mocks for that though.
820cfd2 to
113922b
Compare
113922b to
2fb6a8e
Compare
Cali0707
left a comment
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.
This is looking really good @manusa!
pkg/kubernetes/pods.go
Outdated
| ) | ||
|
|
||
| // Default number of lines to retrieve from the end of the logs | ||
| // DefaultTailLines default number of lines to retrieve from the end of the logs |
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.
nit: DefaultTailLines is the default number of lines ...
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.
fixed, thx
2fb6a8e to
461c02b
Compare
Signed-off-by: Marc Nuri <marc@marcnuri.com>
461c02b to
970fd25
Compare
|
Took a little longer than expected but I think that this should be ready now. If merging the PR, do Rebase and merge as there are two commits I want to preserve in isolation in case we need to rollback. |
Cali0707
left a comment
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, thanks for taking these access control improvements so far @manusa 🤩
Supersedes closes #472
Supersedes closes #473
Supersedes closes #474
Built on top of the changes proposed by @Cali0707 on #473
Should simplify things for #386 and others
This was one of the original plans when implementing the denied resources (#132), but never had the chance to visit appropriately.
Thanks to the work that Calum got started in #473, I think that with the additional changes, we provide robust, resilient access to all client APIs while ensuring that denied resources are not exposed.
If needed this can be decomposed into 2 different pull requests, one for the access control and another for the Kubernetes client set simplification.