Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Initial implementation of managed labels #122

Merged
merged 1 commit into from
Jan 19, 2022

Conversation

adrianludwin
Copy link
Contributor

@adrianludwin adrianludwin commented Jan 17, 2022

See #47. This is the initial implementation of managed labels and
annotations - that is, the ability to set a label (or annotation) in a
HierarchyConfiguration object, and have that label (...) propagated to
all descendants, similar to the way objects are propagated. As with
objects, only allowlisted labels are propagated, as defined by the
command line option '--managed-namespace-[label|annotation]'.

Still to come: validator support, better conditions for conflicts,
better testing for external namespaces, better testing for more regexes,
documentation.

Tested: see new integ tests.

For more information, see design doc

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 17, 2022
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 17, 2022
@adrianludwin
Copy link
Contributor Author

Hey @rjbez17 let's maybe give this a day or two for others to chime in before we submit this?

@adrianludwin adrianludwin added this to the release-v1.0 milestone Jan 17, 2022
@adrianludwin adrianludwin force-pushed the prop-labels branch 4 times, most recently from da7cb28 to 279e6e0 Compare January 17, 2022 20:29
@rjbez17
Copy link
Contributor

rjbez17 commented Jan 17, 2022

Sure thing. Is this a draft and you'll add the other pieces into this PR or follow up with a separate PR?

@adrianludwin
Copy link
Contributor Author

Sure thing. Is this a draft and you'll add the other pieces into this PR or follow up with a separate PR?

No, this is the commit I want to submit. The other pieces can come in other PRs, hopefully including PRs submitted by other people. I just wanted to do the core work myself, but there are people volunteering to do things like add validators so I'd like to take them up on it.

Copy link
Contributor

@erikgb erikgb left a comment

Choose a reason for hiding this comment

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

@adrianludwin I did a first scan - mainly focusing on the "api" to this new feature. I think I need understand more of the HNC concepts before looking into the reconcile logic. 😅 It seems a bit complicated.

@adrianludwin
Copy link
Contributor Author

@adrianludwin I did a first scan - mainly focusing on the "api" to this new feature. I think I need understand more of the HNC concepts before looking into the reconcile logic. 😅 It seems a bit complicated.

Yeah I need to (re?) write a guide to how HNC works internally to make it easier for people to onboard. It's not that complicated once you get it, but it's not exactly intuitive either.

See kubernetes-retired#47. This is the initial implementation of managed labels and
annotations - that is, the ability to set a label (or annotation) in a
HierarchyConfiguration object, and have that label (...) propagated to
all descendants, similar to the way objects are propagated. As with
objects, only allowlisted labels are propagated, as defined by the
command line option '--managed-namespace-[label|annotation]'.

Still to come: validator support, better conditions for conflicts,
better testing for external namespaces, better testing for more regexes,
documentation, end-to-end tests.

Tested: see new integ tests.
Copy link
Contributor

@erikgb erikgb left a comment

Choose a reason for hiding this comment

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

LGTM, but I do not know the core well enough to count! 😉

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adrianludwin, erikgb

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

@adrianludwin
Copy link
Contributor Author

/assign @rjbez17

I think we're ready for a review whenever you are, thanks!

@rjbez17
Copy link
Contributor

rjbez17 commented Jan 19, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 19, 2022
@k8s-ci-robot k8s-ci-robot merged commit 441f27d into kubernetes-retired:master Jan 19, 2022
@adrianludwin adrianludwin deleted the prop-labels branch March 24, 2022 14:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.

5 participants