When referencing a tag such as 1.21, the template throws an error as an incorrect image name is generated. #631

Open
opened 2024-03-17 23:10:40 +00:00 by perfectra1n · 6 comments

I get the following as the template's output for the image name:

gitea/gitea:%!s(float64=1.21)-rootless

When providing the 1.21 tag.

Here's my ArgoCD values:

spec:
  project: default
  source:
    chart: gitea
    repoURL: https://dl.gitea.com/charts/
    targetRevision: '10.1.3'
    helm:
      values: |
        image:
          repository: gitea/gitea
          tag: 1.21
          pullPolicy: Always
          rootless: true        

And here's what it looks like within ArgoCD:
image

However, it works just fine when changing the tag to 1.21.8.

I get the following as the template's output for the image name: ``` gitea/gitea:%!s(float64=1.21)-rootless ``` When providing the `1.21` tag. Here's my ArgoCD values: ```yaml spec: project: default source: chart: gitea repoURL: https://dl.gitea.com/charts/ targetRevision: '10.1.3' helm: values: | image: repository: gitea/gitea tag: 1.21 pullPolicy: Always rootless: true ``` And here's what it looks like within ArgoCD: ![image](/attachments/0ad56674-0303-4640-8791-d53590b2905a) However, it works just fine when changing the tag to `1.21.8`.
Member

I don't know why that occurs. Seems like "yet another ArgoCD" oddity. We had a few of them across different repos lately and I experienced some myself in some other context.

It seems like ArgoCD is using a different parser for the helm templates than just helm?

I don't know why that occurs. Seems like "yet another ArgoCD" oddity. We had a few of them across different repos lately and I experienced some myself in some other context. It seems like ArgoCD is using a different parser for the helm templates than just `helm`?

Just stumbled upon that issue while using helm (version 3.14.2) directly. Seems not to be an ArgoCD problem alone.

Just stumbled upon that issue while using helm (version 3.14.2) directly. Seems not to be an ArgoCD problem alone.

seconds later I got it fixed... ;-)

image:
  repository: gitea/gitea
  tag: "1.21"
  pullPolicy: IfNotPresent

I just added the quotation marks around the tag and the deployment was successful.

seconds later I got it fixed... ;-) ``` image: repository: gitea/gitea tag: "1.21" pullPolicy: IfNotPresent ``` I just added the quotation marks around the tag and the deployment was successful.
Member

@tfoks Thanks for sharing.

@tfoks Thanks for sharing.
Member

I guess we should quote the image tag in the chart when using it as image reference. There are other occurrences of that

app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | quote }}

I guess we should `quote` the image tag in the chart when using it as image reference. There are other occurrences of that https://gitea.com/gitea/helm-chart/src/commit/2a9273d32f0c9ae89903f303dcd7c565ad5e413b/templates/_helpers.tpl#L90
Member

Doesn't seem to be super straightforward, see #641.

Doesn't seem to be super straightforward, see #641.
Sign in to join this conversation.
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/helm-chart#631
No description provided.