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

Generation of template with an url #58

Open
skydjol opened this issue Dec 17, 2024 · 0 comments
Open

Generation of template with an url #58

skydjol opened this issue Dec 17, 2024 · 0 comments
Assignees

Comments

@skydjol
Copy link

skydjol commented Dec 17, 2024

Bug Report

1. Minimal reproduce step (Required)

Use this command
template --file ./examples/workload-charts-with-kcl/kcl-run.yaml

with

# kcl-config.yaml
apiVersion: krm.kcl.dev/v1alpha1
kind: KCLRun
metadata:
  name: set-annotation
spec:
  # EDIT THE SOURCE!
  # This should be your KCL code which preloads the `ResourceList` to `option("items")
  source: |
    [resource | {if resource.kind == "Deployment": metadata.annotations: {"managed-by" = "helm-kcl-plugin"}} for resource in option("items")]

repositories:
#  - name: workload
#    path: ./workload-charts
   - name: nginx-ingress
     url: https://github.com/nginxinc/kubernetes-ingress/tree/v3.1.0/deployments/helm-chart

2. What did you expect to see? (Required)

Yaml generated by helm

3. What did you see instead (Required)

Error: Chart.yaml file is missing
Error: plugin "kcl" exited with error

4. What is your KCL components version? (Required)

From master

Comment

I see this condition seems strange
https://github.com/kcl-lang/helm-kcl/blob/main/pkg/app/app.go#L80

	if err != nil {
		// Load from url
		chart, err = app.render.LoadChartFromRemoteCharts(chartPath)
		if err != nil {
			return nil, err
		}
	} else {
		// Load from local path
		chart, err = app.render.LoadChartFromLocalDirectory(chartPath)
		if err != nil {
			return nil, err
		}
	}

pass always in else condition.

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

3 participants