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

Error when fetching helm chart with 'kustomize build --enable-helm' #4451

Closed
4x3lpri3t0 opened this issue Feb 4, 2022 · 3 comments
Closed
Labels
area/helm 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. triage/duplicate Indicates an issue is a duplicate of other open issue.

Comments

@4x3lpri3t0
Copy link

4x3lpri3t0 commented Feb 4, 2022

Describe the bug

When using a HelmChartInflationGenerator, kustomize fails with the following command:

$ kustomize build --enable-helm

The output is the following:

Error: Error: looks like "oci://f1dev.azurecr.io/helm/f1" is not a valid chart repository or cannot be reached: object required
: unable to run:

'helm pull --untar --untardir /opt/HutchMaster/SharedServer/k8s/f1/kustomize-overlays/dev/we/charts --repo oci://f1dev.azurecr.io/helm/f1 f1 --version 0.1.0'

with env=[HELM_CONFIG_HOME=/var/folders/7q/d7z7scm55kz3jtcwwzdql2m40000gn/T/kustomize-helm-1630665907/helm HELM_CACHE_HOME=/var/folders/7q/d7z7scm55kz3jtcwwzdql2m40000gn/T/kustomize-helm-1630665907/helm/.cache HELM_DATA_HOME=/var/folders/7q/d7z7scm55kz3jtcwwzdql2m40000gn/T/kustomize-helm-1630665907/helm/.data] (is 'helm' installed?)

I can confirm that I get the same error when using helm directly:

helm pull --untar --untardir /opt/HutchMaster/SharedServer/k8s/f1/kustomize-overlays/dev/we/charts --repo oci://f1dev.azurecr.io/helm/f1 f1 --version 0.1.0

Same output as before:

Error: Error: looks like "oci://f1dev.azurecr.io/helm/f1" is not a valid chart repository or cannot be reached: object required

However, when running that very same command but without (!) the --repo flag... it works!

helm pull --untar --untardir /opt/HutchMaster/SharedServer/k8s/f1/kustomize-overlays/dev/we/charts oci://f1dev.azurecr.io/helm/f1 f1 --version 0.1.0

Output:

Pulled: f1dev.azurecr.io/helm/f1:0.1.0
Digest: sha256:001a5edb2a0ab36090b349f5a9ff6d60b2d4713de15c8a40e3be498b660be731

Files that can reproduce the issue

kustomization.yaml:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
generators:
- chartInflator.yaml

chartInflator.yaml:

apiVersion: builtin
kind: HelmChartInflationGenerator
metadata:
  name: f1

# URL to the Repo
repo: "oci://f1dev.azurecr.io/helm/f1"

# The name of the chart to use
name: f1
version: 0.1.0

# Path to a values.yaml
valuesFile: kustom-values.yaml

# The name of the release
releaseName: f1dev
# Namespace to deploy to
releaseNamespace: f1

kustom-values.yaml

(not relevant)

Expected output

The kustomize kustomize --enable-helm command that internally builds this helm command

helm pull --untar --untardir /opt/HutchMaster/SharedServer/k8s/f1/kustomize-overlays/dev/we/charts --repo oci://f1dev.azurecr.io/helm/f1 f1 --version 0.1.0

should be actually building it without the --repo flag:

helm pull --untar --untardir /opt/HutchMaster/SharedServer/k8s/f1/kustomize-overlays/dev/we/charts oci://f1dev.azurecr.io/helm/f1 f1 --version 0.1.0

then it works :)

Actual output

Error: Error: looks like "oci://f1dev.azurecr.io/helm/f1" is not a valid chart repository or cannot be reached: object required

Kustomize version

{Version:kustomize/v4.5.1 GitCommit:746bd18a8c0ba5768b4519778c82a5fb3e667466 BuildDate:2022-02-02T19:02:13Z GoOs:darwin GoArch:amd64}

Helm version

version.BuildInfo{Version:"v3.8.0", GitCommit:"d14138609b01886f544b2025f5000351c9eb092e", GitTreeState:"clean", GoVersion:"go1.17.6"}

Platform

macOs 12.1 (Monterrey)

@4x3lpri3t0 4x3lpri3t0 added the kind/bug Categorizes issue or PR as related to a bug. label Feb 4, 2022
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 4, 2022
@k8s-ci-robot
Copy link
Contributor

@Zedronar: 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/test-infra repository.

@QuinnBast
Copy link

QuinnBast commented Feb 11, 2022

This is a duplicate of #4381

@KnVerey KnVerey added triage/duplicate Indicates an issue is a duplicate of other open issue. area/helm labels Feb 16, 2022
@KnVerey
Copy link
Contributor

KnVerey commented Feb 16, 2022

Closing as duplicate

@KnVerey KnVerey closed this as completed Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm 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. triage/duplicate Indicates an issue is a duplicate of other open issue.
Projects
None yet
Development

No branches or pull requests

4 participants