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

ConfigTemplate crash #5830

Open
salotz opened this issue Mar 14, 2024 · 3 comments
Open

ConfigTemplate crash #5830

salotz opened this issue Mar 14, 2024 · 3 comments

Comments

@salotz
Copy link

salotz commented Mar 14, 2024

Crash report

Error message

--> garden -l4 --force-refresh deploy kapp-example-deploy
[verbose] garden version: 0.13.27
Deploy 

i garden                    → Initializing...
i garden-dashboard          → [debug] Initializing Garden Cloud API client.
[debug] Checking client auth token with the Garden dashboard: https://app.garden.io/token/verify
[debug] Checked client auth token with the Garden dashboard - valid: true
i garden-dashboard          → [debug] Authorizing...
i garden-dashboard          → [debug] Starting refresh interval.
[debug] Will run refresh function every 4500 ms.
i garden-dashboard          → Connecting project...
i garden-dashboard          → [debug] Fetching or creating project carvel-demo from https://app.garden.io
√ garden-dashboard          → Ready
Garden v0.13 (Bonsai) is a major release with significant changes. Please help us improve it by reporting any issues/bugs here:
https://go.garden.io/report-bonsai
→ Run garden util hide-warning 0.13-bonsai to disable this message.
i garden                    → Running in environment local.cvd-local
i git                       → [debug] Scanning project root at /home/salotz/tree/examol/devel/carvel-demo
  → Includes: (none)
  → Excludes: (none)
i git                       → [debug] Found 2236 files in project root /home/salotz/tree/examol/devel/carvel-demo
[debug] Found 2236 files in path /home/salotz/tree/examol/devel/carvel-demo, filtering by 1 include and 6 exclude globs
[debug] Include globs: **/*garden.y*ml
[debug] Exclude globs: .garden/**/*, .git/**/*, .gitmodules, .garden/**/*, debug-info*/**, **/.garden/**/*
[debug] Found 3 files in path /home/salotz/tree/examol/devel/carvel-demo after glob matching
Encountered an unexpected Garden error. This is likely a bug 🍂

You can help by reporting this on GitHub: https://github.com/garden-io/garden/issues/new?labels=bug,crash&template=CRASH.md&title=Crash%3A%20jsonSchema%20must%20be%20a%20valid%20JSON%20Schema%20with%20type%3Dobject%20or%20reference

Please attach the following information to the bug report after making sure that the error message does not contain sensitive information:

Error: jsonSchema must be a valid JSON Schema with type=object or reference
    at new module.exports (file:///home/salotz/.local/share/garden/1709589995-icELlT9.r/rollup/garden.mjs:122140:20)
    at assert$h (file:///home/salotz/.local/share/garden/1709589995-icELlT9.r/rollup/garden.mjs:122163:11)
    at internals.Base.$_addRule (file:///home/salotz/.local/share/garden/1709589995-icELlT9.r/rollup/garden.mjs:129056:30)
    at internals.Base.method [as jsonSchema] (file:///home/salotz/.local/share/garden/1709589995-icELlT9.r/rollup/garden.mjs:149218:29)
    at resolveConfigTemplate (file:///home/salotz/.local/share/garden/1709589995-icELlT9.r/rollup/garden.mjs:790005:36)
    at async Promise.all (index 0)
    at async file:///home/salotz/.local/share/garden/1709589995-icELlT9.r/rollup/garden.mjs:818731:37

What did you do?

garden -l4 --force-refresh deploy kapp-example-deploy
---
kind: ConfigTemplate
name: kapp
inputsSchemaPath: kapp_schema.json

configs:
  - kind: Deploy
    type: exec
    name: ${parent.name}

    dependencies:
      - build.${inputs.build}

    build: ${inputs.build}

    spec:
      deployCommand:
        - kapp
        - deploy
        - "-y"
        - "-a"
        - ${inputs.name}
        - "-f"
        - ${inputs.file}
      cleanupCommand:
        - kapp
        - delete
        - "-y"
        - "-a"
        - ${inputs.name}
{
    "type" : "object",
    "properties" : {
        "build" : {
            "description" : "The garden build action name that generates manifests to deploy.",
            "type": "string",
            "required" : true
        },
        "name" : {
            "description" : "The kapp app name to deploy as",
            "type": "string",
            "required" : true
        },
        "file" : {
            "description" : "File spec to deploy.",
            "type": "string",
            "required" : true
        }
    }
}
---
kind: Build
name: kapp-example-manifests
type: exec
description: |
  Render the K8s manifests using Tanka.
include:
  - environments/kapp-example
  # everything we need for tk to run
  - chartfile.yaml
  - charts
  - jsonnetfile.json
  - jsonnetfile.lock.json
  - lib
  # we need this but skip the symlinks that tanka maintains
  - vendor/github.com

spec:
  shell: true
  command:
    - |
      # TODO: could also just redirect `tk show` to a file, since Kapp
      # can handle the apply ordering
      tk export ./export/kapp-example ./environments/kapp-example
      # remove this for downstream things that choke on this
      rm ./export/kapp-example/manifest.json

---
kind: RenderTemplate
template: kapp
name: kapp-example-deploy
description: |
  Deploy the kapp application, using the ConfigTemplate

inputs:
  build: kapp-example-manifests
  name: kapp-example
  file: ./export/kapp-example/

Your environment

  • OS: OpenSUSE Tumbleweed linux
  • How I'm running Kubernetes:
--> minikube version
minikube version: v1.32.0
commit: 69993dc5f6ebf06f02b2ddf105c428f1a0d85030
  • Garden version: garden version: 0.13.27

Frequency

It reproduces in the same environment.

Workaround

I haven't found anything.

Additional context

@salotz
Copy link
Author

salotz commented Mar 14, 2024

And just to clarify I get the same thing when running other commands, e.g. garden build kapp-example-manifests

@salotz
Copy link
Author

salotz commented Mar 14, 2024

Ahhh the only place this shows up is in the github issue URL haha:

Crash: jsonSchema must be a valid JSON Schema with type=object or reference

@salotz
Copy link
Author

salotz commented Mar 14, 2024

{
    "type" : "object",
    "properties" : {
        "build" : {
            "type": "string"
        },
        "name" : {
            "type": "string"
        },
        "file" : {
            "type": "string"
        }
    }
}

Going basic fixes it.

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

1 participant