kubernetes-sigs / kubernetes-sigs/kustomize

Fails`kustomize build --enable-helm` with a chart without a values.yaml

Open
#6,002 7 comments 0 reactions 1 assignee Claimed by @ffjlabo View on GitHub
area/helm kind/bug triage/accepted
Dominant language
Go
Stars
12.2k
Forks
2.4k
Avg merge
2d 14h
Merged PRs (30d)
25

Description

### What happened?

When executing kustomize build including the karpenter 1.1.0 Helm chart (https://github.com/aws/karpenter-provider-aws/tree/v1.1.0/charts/karpenter-crd), an error occurred, causing the build to fail. This Helm chart does not include a values.yaml.

```
% kustomize build . --enable-helm
Error: evalsymlink failure on '/Users/XXX/repro/kustomize/charts/karpenter-crd-1.1.0/karpenter-crd/values.yaml' : lstat /Users/XXX/repro/kustomize/charts/karpenter-crd-1.1.0/karpenter-crd/values.yaml: no such file or directory
```

On the other hand, the karpenter 1.0.8 Helm chart (https://github.com/aws/karpenter-provider-aws/tree/v1.0.8/charts/karpenter-crd) did not have this issue.
The karpenter 1.0.8 Helm chart includes a values.yaml.

Upon examining the error logs, it appears that the error originates from this part of kustomize.
https://github.com/kubernetes-sigs/kustomize/blob/168971a50110fc90dfbd1327245e7aabe5c07e8f/kyaml/filesys/fsondisk.go#L61-L62

Also, using the helm template command, I confirmed that both charts render successfully.
From the command execution results, it is evident that Helm allows charts without a values.yaml.
- `helm template oci://public.ecr.aws/karpenter/karpenter:1.0.8`
- `helm template oci://public.ecr.aws/karpenter/karpenter:1.1.0`

### What did you expect to happen?

I expected the `kustomize build` to succeed even for charts that do not have a values.yaml.

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

I reproduced it by executing `kustomize build . --enable-helm` with the `helm v3.19.0` and `kustomization.yaml` below.

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

helmCharts:
- name: karpenter-crd
version: 1.1.0
repo: oci://public.ecr.aws/karpenter
releaseName: karpenter-crd
namespace: kube-system
includeCRDs: true
```

### Expected output

The same output with `helm template oci://public.ecr.aws/karpenter/karpenter:1.1.0`

### Actual output

```sh
% kustomize build . --enable-helm
Error: evalsymlink failure on '/Users/XXX/repro/kustomize/charts/karpenter-crd-1.1.0/karpenter-crd/values.yaml' : lstat /Users/XXX/repro/kustomize/charts/karpenter-crd-1.1.0/karpenter-crd/values.yaml: no such file or directory
```

### Kustomize version

v5.7.1

### Operating system

MacOS

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.