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

Closed
opened 2024-03-17 23:10:40 +00:00 by perfectra1n · 6 comments
perfectra1n commented 2024-03-17 23:10:40 +00:00 (Migrated from gitea.com)

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`.
pat-s commented 2024-03-18 10:13:41 +00:00 (Migrated from gitea.com)

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`?
tfoks commented 2024-04-09 09:00:35 +00:00 (Migrated from gitea.com)

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.
tfoks commented 2024-04-09 09:04:00 +00:00 (Migrated from gitea.com)

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.
justusbunsi commented 2024-04-09 15:34:28 +00:00 (Migrated from gitea.com)

@tfoks Thanks for sharing.

@tfoks Thanks for sharing.
justusbunsi commented 2024-04-09 15:38:34 +00:00 (Migrated from gitea.com)

I guess we should quote the image tag in the chart when using it as image reference. There are other occurrences of that 2a9273d32f/templates/_helpers.tpl (L90)

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
pat-s commented 2024-04-16 08:36:01 +00:00 (Migrated from gitea.com)

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 project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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