Skip to content
This repository was archived by the owner on Mar 20, 2026. It is now read-only.

fix: wrong indentation in env causing helm install failure - #2430

Merged
pjuarezd merged 1 commit into
minio:masterfrom
vishal-chdhry:env-indent-fix
Apr 21, 2025
Merged

pjuarezd merged 1 commit into
minio:masterfrom
vishal-chdhry:env-indent-fix

Conversation

@vishal-chdhry

Copy link
Copy Markdown
Contributor

Description

The following values.yaml causes error in current helm chart on main branch:

operator:
  image:
    repository: k3d-k3d.localhost:5005/minio-operator
    tag: unused@sha256:be331832f82ea2e0f1f1c33471b13187941ce17f0f02cc25a037aa51c0771b9e
  sidecarImage:
    repository: k3d-k3d.localhost:5005/minio-operator-sidecar
    tag: unused@sha256:08b374f20a4e67fbd8cb93aa76fabf8b9f50684dce356eccf2540a2c7a7a2237

Error:

Error: YAML parse error on operator/templates/operator-deployment.yaml: error converting YAML to JSON: yaml: line 49: did not find expected key
helm.go:86: 2025-04-21 23:07:23.590851 +0530 IST m=+0.087494917 [debug] error converting YAML to JSON: yaml: line 49: did not find expected key
YAML parse error on operator/templates/operator-deployment.yaml
helm.sh/helm/v3/pkg/releaseutil.(*manifestFile).sort
        helm.sh/helm/v3/pkg/releaseutil/manifest_sorter.go:144
helm.sh/helm/v3/pkg/releaseutil.SortManifests
        helm.sh/helm/v3/pkg/releaseutil/manifest_sorter.go:104
helm.sh/helm/v3/pkg/action.(*Configuration).renderResources
        helm.sh/helm/v3/pkg/action/action.go:168

Its because of this unintentional change in the chart: #2422 (comment)

If I remove operator.env from values.yaml:

operator:
  image:
    repository: k3d-k3d.localhost:5005/minio-operator
    tag: unused@sha256:be331832f82ea2e0f1f1c33471b13187941ce17f0f02cc25a037aa51c0771b9e
  sidecarImage:
    repository: k3d-k3d.localhost:5005/minio-operator-sidecar
    tag: unused@sha256:08b374f20a4e67fbd8cb93aa76fabf8b9f50684dce356eccf2540a2c7a7a2237
  env: ~

I get the following, chart:

      containers:
        - name: operator
          image: "k3d-k3d.localhost:5005/minio-operator:unused@sha256:be331832f82ea2e0f1f1c33471b13187941ce17f0f02cc25a037aa51c0771b9e"
          imagePullPolicy: IfNotPresent
          args:
            - controller
          env:
          - name: "OPERATOR_SIDECAR_IMAGE"
            value: "k3d-k3d.localhost:5005/minio-operator-sidecar:unused@sha256:08b374f20a4e67fbd8cb93aa76fabf8b9f50684dce356eccf2540a2c7a7a2237"

If I remove the operator.sidecarImage from values.yaml:

operator:
  image:
    repository: k3d-k3d.localhost:5005/minio-operator
    tag: unused@sha256:be331832f82ea2e0f1f1c33471b13187941ce17f0f02cc25a037aa51c0771b9e

I get the following:

      containers:
        - name: operator
          image: "k3d-k3d.localhost:5005/minio-operator:unused@sha256:be331832f82ea2e0f1f1c33471b13187941ce17f0f02cc25a037aa51c0771b9e"
          imagePullPolicy: IfNotPresent
          args:
            - controller
          env:
            - name: OPERATOR_STS_ENABLED
              value: "on"
          resources:

These 2 envs are unmergable because of indentation.

This PR fixes this issue:

      containers:
        - name: operator
          image: "k3d-k3d.localhost:5005/minio-operator:unused@sha256:be331832f82ea2e0f1f1c33471b13187941ce17f0f02cc25a037aa51c0771b9e"
          imagePullPolicy: IfNotPresent
          args:
            - controller
          env:
            - name: "OPERATOR_SIDECAR_IMAGE"
              value: "k3d-k3d.localhost:5005/minio-operator-sidecar:unused@sha256:08b374f20a4e67fbd8cb93aa76fabf8b9f50684dce356eccf2540a2c7a7a2237"
            - name: OPERATOR_STS_ENABLED
              value: "on"

Related Issue

Type of Change

  • Bug fix 🐛
  • New feature 🚀
  • Breaking change 🚨
  • Documentation update 📖
  • Refactor 🔨
  • Other (please describe) ⬇️

Screenshots (if applicable e.g before/after)

Checklist

  • I have tested these changes
  • I have updated relevant documentation (if applicable)
  • I have added necessary unit tests (if applicable)

Test Steps

  1. values.yaml
    operator:
      image:
        repository: k3d-k3d.localhost:5005/minio-operator
        tag: unused@sha256:be331832f82ea2e0f1f1c33471b13187941ce17f0f02cc25a037aa51c0771b9e
      sidecarImage:
        repository: k3d-k3d.localhost:5005/minio-operator-sidecar
        tag: unused@sha256:08b374f20a4e67fbd8cb93aa76fabf8b9f50684dce356eccf2540a2c7a7a2237
  2. Run: helm template operator --namespace minio-operator --create-namespace ./helm/operator --values values.yaml --debug

Additional Notes / Context

@pjuarezd pjuarezd mentioned this pull request Apr 21, 2025
3 of 9 tasks
Signed-off-by: Vishal Choudhary <vishal.choudhary@chainguard.dev>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants