feat(kubernetes)!: simplified Kubernetes client access for toolsets#483
feat(kubernetes)!: simplified Kubernetes client access for toolsets#483Cali0707 merged 4 commits intocontainers:mainfrom
Conversation
ed3059a to
11def02
Compare
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.
What about using dynamic.Interface to allow mocking with k8s.io/client-go/dynamic/fake in tests?
There was a problem hiding this comment.
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
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.
nit: DefaultTailLines is the default number of lines ...
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. |
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.