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

Use .Values.image.tag for app.kubernetes.io/version #146

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hinricht
Copy link
Contributor

When specifiying a different image.tag version, the resulting image definitions will use this tag, but the helm labels app.kubernetes.io/version values would still use the AppVersion from Chart.yaml.

Before:

$ helm template -f dev-values.yaml --set image.tag=1.2.3 . |grep -E '(4.2.8|1.2.3)'
    app.kubernetes.io/version: "v4.2.8"
    app.kubernetes.io/version: "v4.2.8"
    app.kubernetes.io/version: "v4.2.8"
    app.kubernetes.io/version: "v4.2.8"
    app.kubernetes.io/version: "v4.2.8"
    app.kubernetes.io/version: "v4.2.8"
    app.kubernetes.io/version: "v4.2.8"
    app.kubernetes.io/version: "v4.2.8"
    app.kubernetes.io/version: "v4.2.8"
          image: "ghcr.io/mastodon/mastodon:1.2.3"
    app.kubernetes.io/version: "v4.2.8"
          image: "ghcr.io/mastodon/mastodon:1.2.3"
    app.kubernetes.io/version: "v4.2.8"
          image: "ghcr.io/mastodon/mastodon:1.2.3"
    app.kubernetes.io/version: "v4.2.8"
              image: "ghcr.io/mastodon/mastodon:1.2.3"
    app.kubernetes.io/version: "v4.2.8"
    app.kubernetes.io/version: "v4.2.8"
    app.kubernetes.io/version: "v4.2.8"
          image: "ghcr.io/mastodon/mastodon:1.2.3"
    app.kubernetes.io/version: "v4.2.8"
          image: "ghcr.io/mastodon/mastodon:1.2.3"
    app.kubernetes.io/version: "v4.2.8"
          image: "ghcr.io/mastodon/mastodon:1.2.3"

With this PR:

 $ helm template -f dev-values.yaml --set image.tag=1.2.3 . |grep -E '(4.2.8|1.2.3)'
    app.kubernetes.io/version: "1.2.3"
    app.kubernetes.io/version: "1.2.3"
    app.kubernetes.io/version: "1.2.3"
    app.kubernetes.io/version: "1.2.3"
    app.kubernetes.io/version: "1.2.3"
    app.kubernetes.io/version: "1.2.3"
    app.kubernetes.io/version: "1.2.3"
    app.kubernetes.io/version: "1.2.3"
    app.kubernetes.io/version: "1.2.3"
        checksum/config-secrets: "02dbb4d23850e2f2d1502951426916d5117c01338e80b5e5cea0bd474973859d"
          image: "ghcr.io/mastodon/mastodon:1.2.3"
    app.kubernetes.io/version: "1.2.3"
        checksum/config-secrets: "02dbb4d23850e2f2d1502951426916d5117c01338e80b5e5cea0bd474973859d"
          image: "ghcr.io/mastodon/mastodon:1.2.3"
    app.kubernetes.io/version: "1.2.3"
        checksum/config-secrets: "02dbb4d23850e2f2d1502951426916d5117c01338e80b5e5cea0bd474973859d"
          image: "ghcr.io/mastodon/mastodon:1.2.3"
    app.kubernetes.io/version: "1.2.3"
              image: "ghcr.io/mastodon/mastodon:1.2.3"
    app.kubernetes.io/version: "1.2.3"
    app.kubernetes.io/version: "1.2.3"
    app.kubernetes.io/version: "1.2.3"
          image: "ghcr.io/mastodon/mastodon:1.2.3"
    app.kubernetes.io/version: "1.2.3"
          image: "ghcr.io/mastodon/mastodon:1.2.3"
    app.kubernetes.io/version: "1.2.3"
          image: "ghcr.io/mastodon/mastodon:1.2.3"

@hinricht hinricht force-pushed the ops-758-fix-version-labels branch 4 times, most recently from 813a14d to caeac54 Compare July 16, 2024 12:56
@jeremiahlee
Copy link
Contributor

This is a good minor fix, aligned with Kubernetes recommendation, that should be merged.

@hinricht
Copy link
Contributor Author

Anyone, please review

@hinricht
Copy link
Contributor Author

https://github.com/mastodon/chart/actions/runs/10794459133/job/29938793409?pr=146:

Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: unknown object type "nil" in ServiceAccount.metadata.labels.app.kubernetes.io/version

Anyone knows why this CI job fails ?

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.

2 participants