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

helmCharts: kyaml fails when encounting helm charts with emty values.yaml files #5720

Open
djfinnoy opened this issue Jun 18, 2024 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@djfinnoy
Copy link

What happened?

After upgrading from 5.3.0 to 5.4.2 we encountered a bug where kustomize has started failing with the following error:

Error: could not parse values file into rnode: EOF 

The bug affects helm charts with an empty values.yaml file.
We have a private helm chart where the default values.yaml files that is packaged alongside the chart is empty, and we typically use valuesInline in kustomize to pass values.

# kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

helmCharts:
  - name: my-libchart
    repo: oci://europe-west1-docker.pkg.dev/my-project/my-chart
    valuesInline:
      someKey: someValue

The issue is that the following function returns an error due to the lack of a populated values.yaml file.

I have found two ways to fix the issue:

  • Use valuesFile instead of (or in addition to) valuesInline.
  • Add any key-value pair to the upstream helm chart so that it no longer has an empty values file (this is our workaround for the time being).

What did you expect to happen?

The replaceValuesInline() should tolerate empty helm values files.

How can we reproduce it (as minimally and precisely as possible)?

# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

helmCharts:
  - name: my-libchart
    repo: file://path/to/helmchart/with/empty/valuesfile
    valuesInline:
      someKey: someValue

Expected output

No error

Actual output

Error

Kustomize version

5.4.2

Operating system

Linux

@djfinnoy djfinnoy added the kind/bug Categorizes issue or PR as related to a bug. label Jun 18, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

2 participants