bjw-s / helm-charts

A collection of Helm charts
https://bjw-s.github.io/helm-charts/
Apache License 2.0
535 stars 100 forks source link

New label / selector "app.kubernetes.io/component" in version 2.0.1 is set to "main", even if I use nameOverride on the main container to change it's name to something else #198

Closed runenielsen closed 9 months ago

runenielsen commented 9 months ago

Details

This is primarily a question to know ensure that the functionality is intentional and hear the reasoning, not necessarily a bug.

There's a new label and selector ( app.kubernetes.io/component) added in the new version 2.0.1 of the chart.

The value of this is set to main. Even if I change the name of the main container in the pod to something other than main.

Is it intentional, that it works like this, and what is the reason?

What did you expect to happen:

I expected the value of the label / selector to be the same as the name of the main pod, but I'm no charting expert, so there is probably a reason for the functionality, that I am not aware of.

Anything else you would like to add:

No.

Additional Information:

No.

bjw-s commented 9 months ago

The component should label should point to the identifier of the controller. So for the main controller it should always be main, and for any additional controller it would take the value of that controller.

The identifier won't get overwritten by the "presentation" name (which gets controlled by nameOverride)

Feel free to reopen if you still feel there's a bug somehow :)

runenielsen commented 9 months ago

Hi @bjw-s

Thanks a lot for your answer! It is good enough for me, if you have checked, that it works as intended - I am definitely not an expert in this 🙂

bjw-s commented 9 months ago

I added some additional unit tests, just in case ;)

runenielsen commented 9 months ago

@bjw-s : Thanks again, that is awesome! 💪