Skip to content

Conversation

pinkavaj
Copy link
Contributor

@pinkavaj pinkavaj commented Jun 6, 2025

Close #496

This improves the compatibility and makes it easier to work with various tools, which take advantage from the assumption of existence of those labels.

Changing the selectors is breaking change, so the bump of the major version of the helm chart.

I'm not sure about the original intention of the use of reloader.matchLabels, it seems to me they kind of duplicate the reloader.labels, but I would like to keep the amount of changes at minimum.

The chart was tested with the following values:

reloader:
  deployment:
    replicas: 2
    priorityClassName:
  enableHA: true
  logFormat: json
  podDisruptionBudget:
    enabled: true
  podMonitor:
    enabled: true
  readOnlyRootFileSystem: true
  reloadOnCreate: true

@@ -27,12 +27,16 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{- define "reloader-match-labels.chart" -}}
app.kubernetes.io/name: {{ template "reloader-name" . }}
Copy link
Contributor

@msafwankarim msafwankarim Jul 2, 2025

Choose a reason for hiding this comment

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

Similar change was added in #835 and later reverted to fix the bug #897. This change will potentially reopen the bug #897

Copy link
Contributor Author

@pinkavaj pinkavaj Jul 2, 2025

Choose a reason for hiding this comment

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

Thanks for mentioning the issue, I'm aware of it and I did my best to avoid the same situation happens again, the labels are now set systematically for all resources, which should prevent this at the cost of need to force-reconciliate during the upgrade. (thus the change of the major version of the helm-chart)

@Felix-Stakater
Copy link
Contributor

Hi @pinkavaj!

Thank you for your contribution! I do think that this looks correct and will not trigger the mentioned bug.

However making a major release means more work both for us writing change-logs and for users reading them to validate major upgrades, so I'm hesitant to upgrade the major version on a technicality.

I do also see your point about standard tooling and such so I would like to propose we split this into 2 PRs.

The first will keep almost all changes, except the reloader-match-labels.chart will have the old keys app and release. We move the keys app.kubernetes.io/name and app.kubernetes.io/instance into reloader-labels.chart.
This is a minor release which could be released very fast to solve for your use-case.

The second one would change the keys used in the reloader-match-labels.chart and remove the old labels app and release entirely. This can be merged the next time we make a major release.

PS. You also have a merge conflict which would need to be resolved. :)

This improves the compatibility and makes it easier to work with various tools,
which take advantake from the assumption of existence of those labels.

Keep the old labels for selectors for backward compatibility.

Also note there is slight change in behaviour of PDB which might
be backward-incompatible in some rare cases.
This improves the compatibility and makes it easier to work with various tools,
which take advantake from the assumption of existence of those labels.
@pinkavaj pinkavaj marked this pull request as draft July 7, 2025 20:39
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.

Use standard kubernetes labels
3 participants