-
Notifications
You must be signed in to change notification settings - Fork 164
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
Manage labels and annotations for a HelmChart #631
Conversation
73c31da
to
d303ada
Compare
33cb9e4
to
8fe2b29
Compare
case !reflect.DeepEqual(template.Annotations, chart.Annotations): | ||
return true | ||
case !reflect.DeepEqual(template.Labels, chart.Labels): | ||
return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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)
Please |
0a82fc4
to
9b69872
Compare
9b366aa
to
14671c0
Compare
Signed-off-by: Raffael Sahli <[email protected]>
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 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.