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

Alloy helmchart image configuration is not compatible with renovate bot #2141

Open
taraspos opened this issue Nov 21, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@taraspos
Copy link

taraspos commented Nov 21, 2024

What's wrong?

Renovate bot supports detecting docker images in helm values files1 that follow conventional format like:

image:
  repository: 'some-docker/dependency'
  tag: v1.0.0
  registry: registry.example.com # optional key, will default to "docker.io"

However, Alloy charts are not compatible with this format due to the additional digest field and un-conventional usage of tag property:

  • image:
    # -- Grafana Alloy image registry (defaults to docker.io)
    registry: "docker.io"
    # -- Grafana Alloy image repository.
    repository: grafana/alloy
    # -- (string) Grafana Alloy image tag. When empty, the Chart's appVersion is
    # used.
    tag: null
    # -- Grafana Alloy image's SHA256 digest (either in format "sha256:XYZ" or "XYZ"). When set, will override `image.tag`.
    digest: null

Renovate bot detects helm-values file and tries to replace tag value:

- tag: v1.4.3
+ tag: v1.4.3@sha256:06bdcbb51fc22b16c2e96b31cbdf9cb0972e3bdedfbac2cc55ed36743f7fb9aa

However, Alloy helm chart expects sha256 to be set in digest field. Attempt to set digest to null and provide digest as part of tag fails with:

metadata.labels: Invalid value: "v1.4.3@sha256:": a valid label must be an empty string or consist of alphanumeric characters, '-', '' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9.])?[A-Za-z0-9])?')

Because helm chart logic tries to get value from tag and add it to the labels:

{{/* substr trims delimeter prefix char from alloy.imageId output
e.g. ':' for tags and '@' for digests.
For digests, we crop the string to a 7-char (short) sha. */}}
app.kubernetes.io/version: {{ (include "alloy.imageId" .) | trunc 15 | trimPrefix "@sha256" | trimPrefix ":" | quote }}

Steps to reproduce

Configure renovate bot to watch alloy's values file

System information

No response

Software version

No response

Configuration


Logs


Footnotes

  1. https://docs.renovatebot.com/modules/manager/helm-values/

@taraspos taraspos added the bug Something isn't working label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant