Code Monkey home page Code Monkey logo

Comments (4)

banjoh avatar banjoh commented on June 26, 2024

Are you able to provide a minimal example we can use to reproduce? I using a default chart generated using helm create and then used helm-schema to generate the json schema. After injecting some extra curly braces in several places, helm lint fails cause the json schema is invalid

from helm.

michael-todorovic avatar michael-todorovic commented on June 26, 2024

Hello, indeed I forgot the example 🤦
I ran helm create foobar and then injected this values.schema.json:

{
    "type": "object",
    "required": [
        "image"
    ],
    "properties": {
        "image": {
            "type": "object",
            "required": [
                "repository",
                "pullPolicy"
            ],
            "properties": {
                "repository": {
                    "type": "string",
                    "pattern": "^([-_/.a-z0-9]+)$"
                },
                "pullPolicy": {
                    "type": "string",
                    "pattern": "^(Always|Never|IfNotPresent)$"
                }
            }}
        }
    }
}

You can see the double curly brace after pullPolicy, which makes the json invalid. However, helm lint is happy:

╰ helm lint . -f values.yaml
==> Linting .
[INFO] Chart.yaml: icon is recommended

1 chart(s) linted, 0 chart(s) failed

helm template likely uses the same code path so it's happy as well.

We found out we broke our json thanks to helm package:

╰ helm package .                         
Error: failed to save: Invalid JSON in values.schema.json

I think we can expect lint+template to fail like package does 😄 For example, our CI lints on dev branches but packages only on release/pre-release

Thanks for your help 🙏

from helm.

banjoh avatar banjoh commented on June 26, 2024

I managed to reproduce the error as well. This is a valid issue

from helm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.