Manage labels and annotations for a HelmChart#631
Merged
hiddeco merged 2 commits intofluxcd:mainfrom Mar 29, 2023
Merged
Conversation
73c31da to
d303ada
Compare
33cb9e4 to
8fe2b29
Compare
hiddeco
reviewed
Mar 7, 2023
Comment on lines
+248
to
+252
| case !reflect.DeepEqual(template.Annotations, chart.Annotations): | ||
| return true | ||
| case !reflect.DeepEqual(template.Labels, chart.Labels): | ||
| return true |
Member
There was a problem hiding this comment.
Maps have a random order, and the comparison must thus be semantic. See e.g.
https://github.com/fluxcd/pkg/blob/main/ssa/manager_diff.go#L151
Contributor
Author
There was a problem hiding this comment.
@hiddeco thx for the review. Fixed now. Note this pr is somewhat related to: fluxcd/notification-controller#482 (or at least thats the reason I added this feature in the first place)
Member
|
Please |
0a82fc4 to
9b69872
Compare
9b366aa to
14671c0
Compare
Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
14671c0 to
2cc2fee
Compare
- Assing `ObjectMeta` field in Helm chart template. - Ensure things are at least lightly mentioned in spec documentation. - Add two simple test cases. - Fix broken links to Kubernetes documentation. Signed-off-by: Hidde Beydals <hidde@hhh.computer>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current situation
It is not possible to manage labels and/or annotations for a HelmChart via the owning HelmRelease resource.
I would expect that I can label the chart via the HelmChart template.
Currently I would need to manage the HelmChart separately in order to maintain some labels.
Proposal
Add support for setting metadata.labels and metadata.annotations.
This pr extends the HelmRelease api.
Note: As it is currently in this pr the labels and annotations are overwritten by the metadata defined in the helmrelease https://github.com/fluxcd/helm-controller/compare/main...raffis:helm-controller:feat-chart-metadata?expand=1#diff-6cc8d46119f3c5f338d63957e402c55243c2abd7dc1d349bd057ce55e219e546R83-R84
Meaning changes done to the HelmChart directly would be overwritten by the helm-controller again.