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

Use unprivileged client (bound to the controllers role) when wiring webhooks/controllers in integration tests #2660

Open
danail-branekov opened this issue Jul 5, 2023 · 0 comments
Assignees
Labels

Comments

@danail-branekov
Copy link
Member

danail-branekov commented Jul 5, 2023

Currently we are wiring webhooks/controllers in integration tests to use a k8s client created out of the default env test config. That config describes a user that is part of the cluster admin groups, therefore controllers in the env test run as admin user. This is however not the case on productive deployments - there controllers/webhooks are run as part of the controller deployment as the controllers manager service account which is bound to the controller manager role.

This difference hides potential bugs with permissions misconfiguration. In order to address that, we need to wire controllers and webhooks in all integration test suites with clients with controller manager permissions. We have already done that here, we need to spread the pattern in all envtests.

@gcapizzi gcapizzi self-assigned this Jul 7, 2023
@gcapizzi gcapizzi added the chore label Jul 7, 2023
kieron-dev pushed a commit that referenced this issue Jul 11, 2023
This also introduces helpers to create and start the manager, and to
create other client with different permissions in testEnvs.

Issue: #2660
Co-authored-by: Danail Branekov <[email protected]>
kieron-dev pushed a commit that referenced this issue Jul 11, 2023
This also introduces helpers to create and start the manager, and to
create other client with different permissions in testEnvs.

Issue: #2660
Co-authored-by: Danail Branekov <[email protected]>
kieron-dev pushed a commit that referenced this issue Jul 11, 2023
This also introduces helpers to create and start the manager, and to
create other client with different permissions in testEnvs.

Issue: #2660
Co-authored-by: Danail Branekov <[email protected]>
danail-branekov added a commit that referenced this issue Jul 12, 2023
This also introduces helpers to create and start the manager, and to
create other client with different permissions in testEnvs.

Issue: #2660
Co-authored-by: Danail Branekov <[email protected]>
danail-branekov added a commit that referenced this issue Jul 12, 2023
This also introduces helpers to create and start the manager, and to
create other client with different permissions in testEnvs.

Issue: #2660
Co-authored-by: Danail Branekov <[email protected]>
danail-branekov added a commit that referenced this issue Jul 13, 2023
This also introduces helpers to create and start the manager, and to
create other client with different permissions in testEnvs.

Issue: #2660
Co-authored-by: Danail Branekov <[email protected]>
danail-branekov added a commit that referenced this issue Jul 13, 2023
This also introduces helpers to create and start the manager, and to
create other client with different permissions in testEnvs.

Issue: #2660
Co-authored-by: Danail Branekov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

4 participants