Help us shape the future of Go! Take the 2026 Go Developer Survey

chartschema

package
v1.42.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package chartschema composes the values schema of a service chart.

A service chart's values are two blocks and nothing else of its own (decision 0009): `platform`, the shape in schemas/fragments/platform.json, and `config`, which is exactly the service's own configuration schema. The chart's `values.schema.json` is therefore not written: it is COMPOSED from a small source file that says which service schema `config` is, so that the schema Helm validates the values with and the schema the binary validates its file with are the same document, and cannot be edited apart.

Composing is bundling. Helm validates offline, and a `$ref` to a URL is a fetch it must not make, so every referenced document is embedded under `$defs`, keyed by its own `$id` (JSON Schema 2020-12's compound document), and each `$ref` is rewritten to that `$id`. Nothing in the result refers to anything outside it.

Index

Constants

View Source
const SourceName = "values.schema.src.json"

SourceName is the file a chart commits beside its `values.schema.json` to say what that schema is composed from.

Variables

This section is empty.

Functions

func Compose

func Compose(fsys fs.FS, src string) ([]byte, error)

Compose reads the source schema at src in fsys and returns the composed schema: the source with every `$ref` to another document resolved and that document embedded under `$defs` by its `$id`.

A relative `$ref` is read from fsys, relative to the file that holds it, and the document it names must carry an absolute `$id`. An absolute one under policy.SchemaBase is read from the schemas this module embeds. Anything else is an error: a reference the composer cannot resolve is one Helm would have to fetch.

The output is deterministic: the same inputs are the same bytes, which is what lets a test compare it with a committed file.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL