kcl-lang / kcl-lang.io

KCL Website and Documentation Repo: https://kcl-lang.io
https://kcl-lang.github.io
Apache License 2.0
12 stars 33 forks source link

[Bug] argocd kcl-pluginfails with error generating manifests: failed to unmarshal manifest: error converting YAML to JSON: yaml: line 2: mapping values are not allowed #343

Closed metacoma closed 2 months ago

metacoma commented 4 months ago

1. Minimal reproduce step (Required)

  1. Deploy argocd with kcl-plugin as described here https://www.kcl-lang.io/blog/2023-07-31-kcl-github-argocd-gitops/
  2. Create application
        argocd app create mindwm \
                --repo https://github.com/mindwm/mindwm-gitops \
                --path . \
                --dest-namespace default \
                --dest-server https://kubernetes.default.svc \
                --revision 8de06cb9005f1419cbb19c978e121567f04c0c7f  \
                --config-management-plugin kcl-v1.0
  3. Sync application
    argocd app sync mindwm

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

Argocd appliaction sync state is "Ok"

3. What did you see instead (Required)

Argocd application sync state is "Fail" with error

error generating manifests: failed to unmarshal manifest: error converting YAML to JSON: yaml: line 2: mapping values are not allowed 

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

0.8.6-linux-amd64

Peefy commented 4 months ago

Thank you very much. Perhaps this is a related issue, https://github.com/crossplane-contrib/function-kcl/issues/68 We will fix it as soon as possible.

NAVRockClimber commented 3 months ago

I stumbled over this issue as well. Is there an estimate when this issue will be tackled?

Peefy commented 3 months ago

I stumbled over this issue as well. Is there an estimate when this issue will be tackled?

@NAVRockClimber Here's a walk around, https://github.com/metacoma/kcl-lang.io/commit/dad815d3ced202285b5a58c9b8e12f8e0516abfd

It is expected to be completed in version 0.9.0 of kcl. And what's your kcl image version?

Peefy commented 2 months ago

Closed by kcl-lang/cli#80 and https://github.com/kcl-lang/kcl/pull/1246

metacoma commented 4 weeks ago

Hey @Peefy

I noticed that the latest kcl-plugin ArgoCD image was built 3 months ago. Could you please trigger image build and add the latest kcl version with this bug fix?

Peefy commented 4 weeks ago

Hello @metacoma

Did you mean the latest KCL docker image here? https://hub.docker.com/r/kcllang/kcl/tags

I've updated the argocd kcl image to kcllang/kcl: https://github.com/kcl-lang/kcl-lang.io/commit/8561f391f1b456001a7a8b84366544f9cdb4bd3f

metacoma commented 4 weeks ago

@Peefy thanks!