Documentation
¶
Overview ¶
Package chartvalues holds the Go types of the preview-env chart's values, from which cmd/schemagen generates charts/preview-env/values.schema.json.
Index ¶
Constants ¶
const NamespacePattern = `^[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?$`
NamespacePattern matches a Kubernetes namespace name (an RFC 1123 label).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PreviewNamespace ¶
type PreviewNamespace struct {
Labels map[string]string `yaml:"labels,omitempty"`
Annotations map[string]string `yaml:"annotations,omitempty"`
}
PreviewNamespace is the extra metadata of the preview Namespace.
func (PreviewNamespace) JSONSchemaExtend ¶
func (PreviewNamespace) JSONSchemaExtend(s *jsonschema.Schema)
JSONSchemaExtend makes both fields optional and rejects, in each, the keys the chart sets on the Namespace. A reserved key maps to the false schema rather than to a propertyNames rule, whose failure Helm reports at a random location.
type ServiceChart ¶
type ServiceChart struct {
Path string `yaml:"path,omitempty"`
ImageTagParam string `yaml:"imageTagParam,omitempty"`
HostParam string `yaml:"hostParam,omitempty"`
ValueFiles []string `yaml:"valueFiles,omitempty"`
}
ServiceChart is a serviceCharts entry: how a service's chart is rendered. Every field is optional.
func (ServiceChart) JSONSchemaExtend ¶
func (ServiceChart) JSONSchemaExtend(s *jsonschema.Schema)
JSONSchemaExtend makes every field optional and every string non-empty.
type Values ¶
type Values struct {
APIVersion string `yaml:"apiVersion"`
Services []preview.ServiceEntry `yaml:"services"`
ServiceCharts map[string]ServiceChart `yaml:"serviceCharts"`
PreviewNamespace PreviewNamespace `yaml:"previewNamespace"`
ArgocdNamespace string `yaml:"argocdNamespace"`
}
Values is the merged input of the preview-env chart: a preview values file (apiVersion, services), the chart settings of the gitops repo's preview-env.yaml (serviceCharts, previewNamespace) and the ApplicationSet's argocdNamespace. No other root key is allowed.
func (Values) JSONSchemaExtend ¶
func (Values) JSONSchemaExtend(s *jsonschema.Schema)
JSONSchemaExtend requires apiVersion, services and argocdNamespace (a null argocdNamespace in a values file removes the chart default before validation, so it must fail as missing), rejects other root keys, fixes apiVersion to preview.APIVersion and argocdNamespace to a namespace name.