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

Replace excluded namespace label with included #36

Merged
merged 1 commit into from
May 18, 2021

Conversation

yiqigao217
Copy link
Contributor

@yiqigao217 yiqigao217 commented May 10, 2021

Part of #9
Next PR would be updating the label concept doc.

Missing excluded-namespace label on system namespaces would break the
entire cluster. Instead of always trying hard to make sure the
excluded-namespace label are set, this PR replaces it with included
namespace concept (included-namespace label added by HC reconciler on
all namespaces except those listed as excluded in the HNC container
args).

Remove the excluded-namespace label. Add the included-namespace label.
Update HC reonciler to always set the included-namespace label to true
on non-excluded namespaces and remove it on excluded namespaces. Update
namespace webhook to block adding/updating the new label improperly.

Update the Makefile to remove the excluded-namespace label setting.

Tested by make test and make test-e2e.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 10, 2021
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 10, 2021
@yiqigao217
Copy link
Contributor Author

/assign @adrianludwin
/assign @rjbez17

@rjbez17 the design of this PR is in #9 (comment). The proposed naming of the label are webhook-enforced or webhook-enabled. WDYT? (this PR uses webhook-enforced, but I can do a text replacement fairly quickly).

internal/reconcilers/hierarchy_config_test.go Outdated Show resolved Hide resolved
internal/validators/namespace.go Outdated Show resolved Hide resolved
internal/validators/namespace.go Outdated Show resolved Hide resolved
internal/validators/namespace.go Outdated Show resolved Hide resolved
internal/validators/namespace.go Outdated Show resolved Hide resolved
Part of 9
Next PR would be updating the label concept doc.

Missing `excluded-namespace` label on system namespaces would break the
entire cluster. Instead of always trying hard to make sure the
`excluded-namespace` label are set, this PR replaces it with included
namespace concept (`included-namespace` label added by HC reconciler on
all namespaces except those listed as excluded in the HNC container
args).

Remove the `excluded-namespace` label. Add the `included-namespace` label.
Update HC reonciler to always set the `included-namespace` label to true
on non-excluded namespaces and remove it on excluded namespaces. Update
namespace webhook to block adding/updating the new label improperly.

Update the Makefile to remove the `excluded-namespace` label setting.

Tested by `make test` and `make test-e2e`.
Copy link
Contributor

@adrianludwin adrianludwin left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold
/assign @rjbez17

internal/validators/namespace.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels May 14, 2021
@yiqigao217
Copy link
Contributor Author

/hold cancel

@rjbez17 Please feel free to take a look. FYI I will make the VWH rules on namespaces included-namespace label in this PR into MWH in the next PR (see discussion #36 (comment))

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 18, 2021
@rjbez17
Copy link
Contributor

rjbez17 commented May 18, 2021

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rjbez17, yiqigao217

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 18, 2021
@k8s-ci-robot k8s-ci-robot merged commit ba15870 into kubernetes-sigs:master May 18, 2021
@adrianludwin adrianludwin added this to the release-v0.9 milestone Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants