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

Not able to render kustomization file using helmCharts with oci:// repository url. #222

Closed
4 tasks done
JanGrosse opened this issue Nov 20, 2023 · 2 comments
Closed
4 tasks done

Comments

@JanGrosse
Copy link

Checklist

  • I've searched the issue queue to verify this is not a duplicate bug report.
  • I've included steps to reproduce the bug.
  • I've pasted the output of kargo version.
  • I've pasted logs, if applicable.

Description

We are using kustomize as the main templating language in our repositories. Sometimes we combine this with helmCharts.
When I want to render such a kustomization template to plain files I receive an error if the kustomization uses helmCharts and specifies a oci:// repository.

Steps to Reproduce

Create a kustomization.yaml which uses a helmChart in your repository inside a kargo directory e.g.

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

helmCharts:
- name: kargo 
  version: 0.2.0
  repo: oci://ghcr.io/akuity/kargo-charts/kargo
  valuesFile: values.yaml
  namespace: kargo 
  releaseName: kargo 
  includeCRDs: true

Add a kargo-render.yaml

configVersion: v1alpha1
branchConfigs:
- pattern: test
  appConfigs:
    kargo:
      configManagement:
        kustomize:
          path: kargo
          enableHelm: true
      outputPath: kargo

Run local docker

docker run -it ghcr.io/akuity/kargo-render:v0.1.0-rc.33 kargo-render render  --repo "<repository>"  --repo-username "<user>"   --repo-password  "<password>" --target-branch "test"

Receive error

Error: error pre-rendering manifests: error generating manifests using Argo CD repo server: `kustomize build /tmp/3315312386/repo/kargo --enable-helm --load-restrictor LoadRestrictionsRootOnly` failed exit status 1: Error: Error: looks like "oci://ghcr.io/akuity/kargo-charts/kargo" is not a valid chart repository or cannot be reached: object required
: unable to run: 'helm pull --untar --untardir /tmp/3315312386/repo/kargo/charts --repo oci://ghcr.io/akuity/kargo-charts/kargo kargo --version 0.2.0' with env=[HELM_CONFIG_HOME=/tmp/kustomize-helm-4020257331/helm HELM_CACHE_HOME=/tmp/kustomize-helm-4020257331/helm/.cache HELM_DATA_HOME=/tmp/kustomize-helm-4020257331/helm/.data] (is 'helm' installed?): exit status 1

Screenshots

Also tested with kargo v0.2.0 results in the same error as local

kargo-render-error

Version

Tested with ghcr.io/akuity/kargo-render:v0.1.0-rc.33.
I wanted to test with the version from the docs (ghcr.io/akuity/kargo-render:v0.1.0-rc.25) but this seems no longer available. It results just in

Unable to find image 'ghcr.io/akuity/kargo-render:v0.1.0-rc.25' locally
docker: Error response from daemon: manifest unknown.
See 'docker run --help'.

Additional Notes

I think this is related to this issue which got fixed in kustomize with this PR
ArgoCD also bumped the kustomize version to 5.2.1 with the 2.9.0 Release.

I checked the go.mod file and saw tha kargo-render still uses ArgoCD in version 2.8.4 - if this is already the issue then the open PR would fix my issue already :-)

Greetings,
Jan.

@krancour
Copy link
Member

I checked the go.mod file and saw tha kargo-render still uses ArgoCD in version 2.8.4 - if this is already the issue then the #221 would fix my issue already :-)

I love it when it's that simple!

I will forewarn you, however, that main has significant breaking changes to the schema for the kargo-render.yaml file, so while an upcoming rc.34 may fix your issue, you will also have to update your config.

We will, of course, document those changes. Just didn't want you caught by surprise if you happened to build from source.

@krancour
Copy link
Member

Fixed by #221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants