Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That is when you are writing the values when using the chart though, right? Yeah that's not too hard.

I was talking about the go templates that make up the actual chart. Ensuring they only use string values for annotations for example seems like a hard problem to solve. Even just showing the type and description from the schema seems nontrivial.





I don't exactly follow which part you're talking about, but yes JetBrains propagates the type and description from the JSON Schema into the golang templates inside the manifest files, same as it does with any type completion. They are reflected as their JSON Schema types, not golang's types, which I could imagine is potentially confusing to someone used to golang's view of the world but is for sure considerably better than "hurr, the type is whatever you say it is" which will be the case for values.yaml files without an accompanying .schema.json file

---

As for the "only string values for annotations," I think you mean patternProperties:

  {
    "$schema": "http://json-schema.org/draft-07/schema",
    "type": "object",
    "properties": {
      "annotations": {
        "type": "object",
        "description": "this is the description of the annotations key itself",
        "additionalProperties": false,
        "patternProperties": {
          "^[a-z][a-z0-9./]+$": {
            "type": "string",
            "description": "holds the value of the annotation"
          }
        }
      }
    }
  }
and if I put the following, then the 123 gets flagged as a schema violation

  annotations:
    alpha: 123
as does

  annotations:
    _: xxx
    0xcafebabe: denied
---

If you mean schema checking on the output, that is checked by the OpenAPI built into Kubernetes itself, so yes, doing something silly in golang templates will not, by itself, check the result - that's one of the major limitations of Helm's moronic choice of using a text templating language for a structured file format


Oh, OK. I didn't realize it made them visible in the golang templates.



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: