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

[feature] Support watch any k8s resource #79

Closed
Colvin-Y opened this issue Jun 27, 2024 · 4 comments
Closed

[feature] Support watch any k8s resource #79

Colvin-Y opened this issue Jun 27, 2024 · 4 comments

Comments

@Colvin-Y
Copy link

Colvin-Y commented Jun 27, 2024

User may want to watch their own crd objects, like advanced-statefulset in openkruise. Current object types is too few.\

Actually, if user config kube-watch controller rbac correcly, we can use k8s.io/client-go/dynamic/dynamicinformer to watch any unstructured object if we know it's gvk info (resources can be found by discovery client)\

By this implementation, pkg/controller/controller.go::Start() function will be more short and clear. We can remove so many if conf.Resource.XXX branch.

@Colvin-Y Colvin-Y changed the title [feature] Support watch any resources [feature] Support watch any k8s resource Jun 27, 2024
@aantn
Copy link
Collaborator

aantn commented Jun 27, 2024

Hi @Colvin-Y, can you try this branch and let me know how it works for you?

#76

@Colvin-Y
Copy link
Author

Hi @Colvin-Y, can you try this branch and let me know how it works for you?

#76
Hi @aantn,
Uhuh,nice PR! implementation is same as what I think. I'd like to try it recently, may this weekend.
Btw, why dont'u refactor controller.go to tidy so many if conf.Resource.XXX case. \

@aantn
Copy link
Collaborator

aantn commented Jun 27, 2024

Yes, I think it it possible. It is quite an eyesore right now.

@aantn
Copy link
Collaborator

aantn commented Aug 19, 2024

Now supported in the latest version!

@aantn aantn closed this as completed Aug 19, 2024
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

No branches or pull requests

2 participants