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

[v0.7] Backport clusterRoles and clusterRoleBindings fixes #361

Merged
merged 3 commits into from
Aug 23, 2021

Conversation

davidor
Copy link
Member

@davidor davidor commented Aug 23, 2021

What does this PR do?

Merges #358, #359, and #360 in the v0.7 branch.
Notice that the base branch of this PR is v0.7.

…s are deleted (#359)

* controllers/datadogagent: don't set dda as owner for cluster roles and bindings

DatadogAgent objects are namespace-scoped whereas clusterRoles and
clusterRolesBindings are not. This means that DatadogAgent cannot be the
owner ref (kubernetes shows warnings in `kubectl get events`).

This owner ref is ignored when cascade deleting, so clusterRoles and
clusterRolesBindings are never deleted. Also, the owner ref field is
never updated even if a new DatadogAgent with the same name is created.

* controllers/datadogagent/common_rbac: use labels when deleting ClusterRoles and ClusterRoleBindings

* controllers/datadogagent/common_rbac: add helper to get RBAC names for a DDA

* controllers/datadogagent/finalizer: delete owned cluster roles and bindings

* controllers/datadogagent/controller_test: check ownership labels
@davidor davidor requested a review from a team as a code owner August 23, 2021 09:45
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request does not contain a valid label. Please add one of the following labels: bug, enhancement, documentation

@davidor davidor added the bug Something isn't working label Aug 23, 2021
@davidor davidor merged commit 9655bc5 into v0.7 Aug 23, 2021
@davidor davidor deleted the davidor/0.7-backport-clusteroles-and-bindings-fixes branch August 23, 2021 12:36
@clamoriniere clamoriniere mentioned this pull request Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants