roboll / helmfile

Deploy Kubernetes Helm Charts
MIT License
4.05k stars 566 forks source link

Adding an OCI repo to repositories breaks if helmfile.lock is present #2075

Open denist-huma opened 2 years ago

denist-huma commented 2 years ago

Reproduce

Start with a hemlfile.yaml

repositories:
  - name: jetstack
    url: https://charts.jetstack.io

releases:
  - name: cert-manager
    namespace: cert-manager
    chart: jetstack/cert-manager
    version: v1.6.1
    wait: true
    timeout: 300
    atomic: true
    cleanupOnFail: true
    createNamespace: true
    set:
      # for GKE also need a firewall rule https://cert-manager.io/docs/installation/compatibility/
      - name: webhook.securePort
        value: 8443
      - name: installCRDs
        value: true

run helmfile deps, helmfile.lock would be like:

version: v0.143.0
dependencies:
- name: cert-manager
  repository: https://charts.jetstack.io
  version: v1.6.1
digest: sha256:42efdf240ca1f4a8d19e8566204dcd50af1532e1e6b0fc9985ba59a00eee2593
generated: "2022-02-02T17:04:31.604181725+03:00"

Adding an OCI repo to repositories

repositories:
  - name: huma
    url: ghcr.io/huma-engineering/helm-charts
    oci: true
  - name: jetstack
    url: https://charts.jetstack.io

releases:
  - name: cert-manager
    namespace: cert-manager
    chart: jetstack/cert-manager
    version: v1.6.1
    wait: true
    timeout: 300
    atomic: true
    cleanupOnFail: true
    createNamespace: true
    set:
      # for GKE also need a firewall rule https://cert-manager.io/docs/installation/compatibility/
      - name: webhook.securePort
        value: 8443
      - name: installCRDs
        value: true

  - name: compose-operator
    namespace: compose-operator
    # chart: ../charts/compose-operator
    chart: huma/compose-operator
    version: 0.39.0

Try to get template:

$ helmfile template
Adding repo jetstack https://charts.jetstack.io
"jetstack" has been added to your repositories

in ./helmfile.yaml: [no resolved dependency found for "compose-operator", running "helmfile deps" may resolve the issue]

run helmfile deps, helmfile.lock would not change.

$ helmfile deps
Adding repo jetstack https://charts.jetstack.io
"jetstack" has been added to your repositories

Pulling ghcr.io/huma-engineering/helm-charts/compose-operator:0.39.0
Exporting ghcr.io/huma-engineering/helm-charts/compose-operator:0.39.0
Pulled: ghcr.io/huma-engineering/helm-charts/compose-operator:0.39.0
Digest: sha256:59632103db46727136a1cd08388cced3ee802e596f1d119a2b2bd6318b93fa06

Exporting ghcr.io/huma-engineering/helm-charts/compose-operator:0.39.0
Pulled: ghcr.io/huma-engineering/helm-charts/compose-operator:0.39.0
Digest: sha256:59632103db46727136a1cd08388cced3ee802e596f1d119a2b2bd6318b93fa06

Updating dependency /tmp/helmfile2282725958/compose-operator/compose-operator/compose-operator/0.39.0/compose-operator
Updating dependency /tmp/2481716747
Hang tight while we grab the latest from your chart repositories...

...Successfully got an update from the "jetstack" chart repository

Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading cert-manager from repo https://charts.jetstack.io
Deleting outdated charts

End result is like in this gist

I am stuck in a loop. helmfile deps don't change the .lock, template is asking to read from lock.

denist-huma commented 2 years ago

I got problem with the OCI repo only, and I got a workaround for my case: to delete the existing helmfile.lock.

day1118 commented 1 year ago

Are there plans to resolve this and improve the OCI support so the lock file does not have to be removed manually?

yxxhero commented 1 year ago

@day1118 please see: https://github.com/roboll/helmfile/issues/2148

day1118 commented 1 year ago

@day1118 please see: #2148

I don't know how I missed that, thanks @yxxhero !