Documentation
¶
Overview ¶
Package schemas provides the JSON schemas embedded into the nelm binary, so that resources can be validated without network access. The archives are committed rather than built, so that importing nelm as a library gets them too; they are regenerated by scripts/schemagen, see data/README.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KubeVersion ¶
KubeVersion returns the Kubernetes version resources are validated against: the newest the embedded schemas were collected from, pinned when they are generated.
func KubeVersions ¶
KubeVersions returns the Kubernetes versions the embedded schemas were collected from, newest first.
Types ¶
type Bundle ¶
type Bundle struct {
FilesCount int `json:"filesCount"`
// KubeVersions are ordered newest first, and only set for the Kubernetes bundle.
KubeVersions []string `json:"kubeVersions,omitempty"`
SHA256 string `json:"sha256"`
UncompressedSize int64 `json:"uncompressedSize"`
UpstreamCommit string `json:"upstreamCommit"`
UpstreamRef string `json:"upstreamRef"`
UpstreamRepo string `json:"upstreamRepo"`
// UpstreamTrees maps each collected Kubernetes version to the git tree sha of the upstream
// directory its schemas came from, which is what tells a moved ref that changed those schemas from
// one that did not. Only set for the Kubernetes bundle.
UpstreamTrees map[string]string `json:"upstreamTrees,omitempty"`
}
Bundle describes one embedded archive. It is generated alongside the archive itself.
type Index ¶
type Index struct {
CRDs *Bundle `json:"crds"`
// Kubernetes holds several minor versions merged into one flat set: the newest contributes all of
// its schemas, every older one only what no newer version has any more, which is what keeps
// resources of API versions removed along the way validatable.
Kubernetes *Bundle `json:"kubernetes"`
}
Index describes the bundles embedded into this binary. Both are always present: a binary that cannot validate resources on its own is not a supported build.
type Source ¶
type Source struct {
// Template is a kubeconform schema source: a path template into the unpacked bundle.
Template string
// contains filtered or unexported fields
}
Source is a kubeconform schema source backed by an embedded bundle.
func CRDsSource ¶
CRDsSource returns the schema source backed by the embedded CRD catalog.
func KubernetesSource ¶
KubernetesSource returns the schema source backed by the embedded Kubernetes schemas.