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

[BUG] OCI charts does not seem to work when using khelm as a KRM container function or EXEC plugin #72

Closed
ellakk opened this issue Mar 17, 2024 · 2 comments

Comments

@ellakk
Copy link

ellakk commented Mar 17, 2024

Describe the bug

Using the example (using version 0.35.0 instead of 0.27.0 as it seems unavailable) with Kustomize exec plugin or Kustomize KRM function i get the following error:

Running khelm 2.3.3 (helm 3.11.3)
Using repository "oci://public.ecr.aws/karpenter" (unauthenticated)
Downloading repository index of oci://public.ecr.aws/karpenter
khelm: load chart karpenter: looks like "oci://public.ecr.aws/karpenter" is not a valid chart repository or cannot be reached: object required

The cli does work however:

khelm template myreleasex oci://public.ecr.aws/karpenter/karpenter --version 0.35.0
Running khelm 2.3.3 (helm 3.11.3)
Downloading chart oci://public.ecr.aws/karpenter/karpenter 0.35.0 from repo 
Rendering chart karpenter 0.35.0 with name "myreleasex" and namespace "default"

To Reproduce
Steps to reproduce the behavior:

Exec:

  1. Download the OCI example in this repository
  2. Install the khelm Kustomize exec plugin
  3. Run Kustomize with "kustomize build --enable-alpha-plugins --enable-exec --network ."

KRM:

  1. Do step one from Exec.
  2. Append the following to metadata in the generator.yaml in the example and do:
metadata:
  annotations:
    config.kubernetes.io/function: |
      container:
        image: mgoltzsche/khelm:latest
        network: true
  1. Run Kustomize with "kustomize build --enable-alpha-plugins --enable-exec --network ."

Expected behavior
The chart should be inflated.

khelm version:
Running khelm 2.3.3 (helm 3.11.3)

Desktop (please complete the following information):

  • OS: NixOS

Additional context

I've tried with other OCI charts than the one in the example directory and i can't get any to work.

@mgoltzsche
Copy link
Owner

mgoltzsche commented Mar 18, 2024

Looks like I forgot to update the example when I changed the implementation to behave like the Helm CLI: accepting the OCI image URI in the chart field, not as repository.
I'll adjust the example and make an e2e test render it...

mgoltzsche added a commit that referenced this issue Apr 11, 2024
...within a kustomize plugin or kpt function config.

Closes #72
mgoltzsche added a commit that referenced this issue Apr 11, 2024
...within a kustomize plugin or kpt function config.

Relates to #72
mgoltzsche added a commit that referenced this issue Apr 11, 2024
...within a kustomize plugin or kpt function config.

Relates to #72
mgoltzsche added a commit that referenced this issue Apr 11, 2024
Support specifying an OCI registry URI within the `repository` field of the kustomize plugin or kpt function config.

Relates to #72
mgoltzsche added a commit that referenced this issue Apr 11, 2024
Support specifying an OCI registry URI within the `repository` field of the kustomize plugin or kpt function config.

Relates to #46 and #72
mgoltzsche added a commit that referenced this issue Apr 11, 2024
Support specifying an OCI repository URI within the `repository` field of the kustomize plugin or kpt function config.

Relates to #46 and #72
mgoltzsche added a commit that referenced this issue Apr 11, 2024
Support specifying an OCI repository URI within the `repository` field of the kustomize plugin or kpt function config.

Relates to #46 and #72
@mgoltzsche
Copy link
Owner

mgoltzsche commented Apr 11, 2024

@ellakk Working more with OCI chart repositories, I realized that the OCI repository can be declared within the repository field of a dependency within the Chart.yaml file. Correspondingly I adjusted khelm and released it with v2.3.4.
For backward-compatibility you can still leave the repository field within the the kustomize plugin or kpt function config empty and specify the whole image name (prefixed with oci://) within the chart field.

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

No branches or pull requests

2 participants