Skip to content

Conversation

@manusa
Copy link
Member

@manusa manusa commented Nov 20, 2025

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.

@manusa manusa added this to the 0.1.0 milestone Nov 20, 2025
@manusa manusa force-pushed the feat/access-control branch from ed3059a to 11def02 Compare November 20, 2025 14:57
Copy link
Collaborator

@Cali0707 Cali0707 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on and expanding on #473 so much @manusa !

This looks great so far, left a few comments

@manusa manusa force-pushed the feat/access-control branch 2 times, most recently from 2eafcbc to 820cfd2 Compare November 21, 2025 13:15
cfg *rest.Config
kubernetes.Interface
discoveryClient discovery.CachedDiscoveryInterface
dynamicClient *dynamic.DynamicClient

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?

Copy link
Member Author

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.

@manusa manusa force-pushed the feat/access-control branch from 820cfd2 to 113922b Compare November 21, 2025 14:38
@manusa manusa changed the title WIP feat(kubernetes)!: simplified Kubernetes client access for toolsets feat(kubernetes)!: simplified Kubernetes client access for toolsets Nov 21, 2025
@manusa manusa force-pushed the feat/access-control branch from 113922b to 2fb6a8e Compare November 21, 2025 14:41
Copy link
Collaborator

@Cali0707 Cali0707 left a 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!

)

// 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
Copy link
Collaborator

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 ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thx

@manusa manusa force-pushed the feat/access-control branch from 2fb6a8e to 461c02b Compare November 21, 2025 14:48
@manusa manusa force-pushed the feat/access-control branch from 461c02b to 970fd25 Compare November 21, 2025 14:49
@manusa
Copy link
Member Author

manusa commented Nov 21, 2025

Took a little longer than expected but I think that this should be ready now.
I'm planning on some follow-up changes to further simplify the kubernetes.Manager and related, but it'll be better to defer those to further PRs.

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.

@manusa manusa marked this pull request as ready for review November 21, 2025 14:55
@manusa manusa requested review from Cali0707 and lyarwood November 21, 2025 14:57
Copy link
Collaborator

@Cali0707 Cali0707 left a 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 🤩

@Cali0707 Cali0707 merged commit 17126a0 into containers:main Nov 21, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants