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

feat(helm): All recommended Kubernetes labels #1538

Merged
merged 4 commits into from
Jun 3, 2024

Conversation

nlamirault
Copy link
Contributor

@nlamirault nlamirault commented May 15, 2024

Add missing labels and refactoring additional labels.

I don't change Helm chart version, because it is v0.1.4 but in documentation, it is v5.9.0:

helm upgrade -i grafana-operator oci://ghcr.io/grafana/helm-charts/grafana-operator --version v5.9.0

Copy link
Collaborator

@NissesSenap NissesSenap left a comment

Choose a reason for hiding this comment

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

Think it's a good idea to move Values.additionalLabels to _helpers.tpl.
But there is no need to separately define app.kubernetes.io/component for each object, see my comment below.

I'm also happy that you don't update the selectorLabels, since it was a pain to update last time.

There is no need to bump the helm chart, we do that in CI.

Comment on lines +50 to +53
app.kubernetes.io/part-of: grafana-operator
{{- with .Values.additionalLabels }}
{{ toYaml . }}
{{- end }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This I think is a good idea

{{- toYaml . | nindent 4 }}
{{- end }}
{{- include "grafana-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: config
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't agree with your interpretation of how app.kubernetes.io/component should be used.
The component is related to the whole object, in this case grafana-operator. It doesn't differ between object like rbac or network.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@NissesSenap so what do you like for this label ? just grafana-operator or operator ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

operator I guess

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

Signed-off-by: Nicolas Lamirault <[email protected]>
Signed-off-by: Nicolas Lamirault <[email protected]>
@theSuess theSuess added this pull request to the merge queue Jun 3, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jun 3, 2024
feat(helm): All recommended Kubernetes labels
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 3, 2024
@theSuess theSuess added this pull request to the merge queue Jun 3, 2024
Merged via the queue into grafana:master with commit f64b541 Jun 3, 2024
14 checks passed
@@ -21,9 +19,7 @@ spec:
{{- end }}
labels:
{{- include "grafana-operator.selectorLabels" . | nindent 8 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

grafana-operator.selectorLabels don't include .Values.additionalLabels, so removing the with block is a breaking change; since this change landed, it's not possible to set additional pod labels.

I believe this can be easily fixed by including grafana-operator.labels instead:

Suggested change
{{- include "grafana-operator.selectorLabels" . | nindent 8 }}
{{- include "grafana-operator.labels" . | nindent 8 }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants