Documentation
¶
Overview ¶
Package v3 provides chart handling for apiVersion v3 charts
This package and its sub-packages provide handling for apiVersion v3 charts.
Index ¶
- Constants
- type CRD
- type Chart
- func (ch *Chart) AddDependency(charts ...*Chart)
- func (ch *Chart) AddRuntimeFile(name string, data []byte)
- func (ch *Chart) AppVersion() string
- func (ch *Chart) CRDObjects() []CRD
- func (ch *Chart) CRDs() []*common.File
- func (ch *Chart) ChartFullPath() string
- func (ch *Chart) ChartPath() string
- func (ch *Chart) Dependencies() []*Chart
- func (ch *Chart) IsRoot() bool
- func (ch *Chart) Name() string
- func (ch *Chart) Parent() *Chart
- func (ch *Chart) RemoveRuntimeFile(name string)
- func (ch *Chart) Root() *Chart
- func (ch *Chart) SetDependencies(charts ...*Chart)
- func (ch *Chart) Validate() error
- type Dependency
- type Lock
- type Maintainer
- type Metadata
- type ValidationError
Constants ¶
const APIVersionV3 = "v3"
APIVersionV3 is the API version number for version 3.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chart ¶
type Chart struct {
// Raw contains the raw contents of the files originally contained in the chart archive.
//
// This should not be used except in special cases like `helm show values`,
// where we want to display the raw values, comments and all.
Raw []*common.File `json:"-"`
// Metadata is the contents of the Chartfile.
Metadata *Metadata `json:"metadata"`
// Lock is the contents of Chart.lock.
Lock *Lock `json:"lock"`
// Templates for this chart.
Templates []*common.File `json:"templates"`
// Values are default config for this chart.
Values map[string]any `json:"values"`
// Schema is an optional JSON schema for imposing structure on Values
Schema []byte `json:"schema"`
// SchemaModTime the schema was last modified
SchemaModTime time.Time `json:"schemamodtime"`
// Files are miscellaneous files in a chart archive,
// e.g. README, LICENSE, etc.
Files []*common.File `json:"files"`
// ModTime the chart metadata was last modified
ModTime time.Time `json:"modtime,omitzero"`
RuntimeFiles []*common.File `json:"-"`
ExtraValues map[string]interface{} `json:"-"`
SecretsRuntimeData common.RuntimeData `json:"-"`
// contains filtered or unexported fields
}
Chart is a helm package that contains metadata, a default config, zero or more optionally parameterizable templates, and zero or more charts (dependencies).
func (*Chart) AddDependency ¶
AddDependency determines if the chart is a subchart.
func (*Chart) AddRuntimeFile ¶
func (*Chart) AppVersion ¶
AppVersion returns the appversion of the chart.
func (*Chart) CRDObjects ¶
CRDObjects returns a list of CRD objects in the 'crds/' directory of a Helm chart & subcharts
func (*Chart) CRDs ¶
CRDs returns a list of File objects in the 'crds/' directory of a Helm chart. Deprecated: use CRDObjects()
func (*Chart) ChartFullPath ¶
ChartFullPath returns the full path to this chart. Note that the path may not correspond to the path where the file can be found on the file system if the path points to an aliased subchart.
func (*Chart) Dependencies ¶
Dependencies are the charts that this chart depends on.
func (*Chart) RemoveRuntimeFile ¶
func (*Chart) SetDependencies ¶
SetDependencies replaces the chart dependencies.
type Dependency ¶
type Dependency struct {
// Name is the name of the dependency.
//
// This must mach the name in the dependency's Chart.yaml.
Name string `json:"name" yaml:"name"`
// Version is the version (range) of this chart.
//
// A lock file will always produce a single version, while a dependency
// may contain a semantic version range.
Version string `json:"version,omitempty" yaml:"version,omitempty"`
// The URL to the repository.
//
// Appending `index.yaml` to this string should result in a URL that can be
// used to fetch the repository index.
Repository string `json:"repository" yaml:"repository"`
// A yaml path that resolves to a boolean, used for enabling/disabling charts (e.g. subchart1.enabled )
Condition string `json:"condition,omitempty" yaml:"condition,omitempty"`
// Tags can be used to group charts for enabling/disabling together
Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"`
// Enabled bool determines if chart should be loaded
Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
// ImportValues holds the mapping of source values to parent key to be imported. Each item can be a
// string or pair of child/parent sublist items.
ImportValues []any `json:"import-values,omitempty" yaml:"import-values,omitempty"`
// Alias usable alias to be used for the chart
Alias string `json:"alias,omitempty" yaml:"alias,omitempty"`
}
Dependency describes a chart upon which another chart depends.
Dependencies can be used to express developer intent, or to capture the state of a chart.
func (*Dependency) Validate ¶
func (d *Dependency) Validate() error
Validate checks for common problems with the dependency datastructure in the chart. This check must be done at load time before the dependency's charts are loaded.
type Lock ¶
type Lock struct {
// Generated is the date the lock file was last generated.
Generated time.Time `json:"generated"`
// Digest is a hash of the dependencies in Chart.yaml.
Digest string `json:"digest"`
// Dependencies is the list of dependencies that this lock file has locked.
Dependencies []*Dependency `json:"dependencies"`
}
Lock is a lock file for dependencies.
It represents the state that the dependencies should be in.
type Maintainer ¶
type Maintainer struct {
// Name is a user name or organization name
Name string `json:"name,omitempty"`
// Email is an optional email address to contact the named maintainer
Email string `json:"email,omitempty"`
// URL is an optional URL to an address for the named maintainer
URL string `json:"url,omitempty"`
}
Maintainer describes a Chart maintainer.
func (*Maintainer) Validate ¶
func (m *Maintainer) Validate() error
Validate checks valid data and sanitizes string characters.
type Metadata ¶
type Metadata struct {
// The name of the chart. Required.
Name string `json:"name,omitempty"`
// The URL to a relevant project page, git repo, or contact person
Home string `json:"home,omitempty"`
// Source is the URL to the source code of this chart
Sources []string `json:"sources,omitempty"`
// A SemVer 2 conformant version string of the chart. Required.
Version string `json:"version,omitempty"`
// A one-sentence description of the chart
Description string `json:"description,omitempty"`
// A list of string keywords
Keywords []string `json:"keywords,omitempty"`
// A list of name and URL/email address combinations for the maintainer(s)
Maintainers []*Maintainer `json:"maintainers,omitempty"`
// The URL to an icon file.
Icon string `json:"icon,omitempty"`
// The API Version of this chart. Required.
APIVersion string `json:"apiVersion,omitempty"`
// The condition to check to enable chart
Condition string `json:"condition,omitempty"`
// The tags to check to enable chart
Tags string `json:"tags,omitempty"`
// The version of the application enclosed inside of this chart.
AppVersion string `json:"appVersion,omitempty"`
// Whether or not this chart is deprecated
Deprecated bool `json:"deprecated,omitempty"`
// Annotations are additional mappings uninterpreted by Helm,
// made available for inspection by other applications.
Annotations map[string]string `json:"annotations,omitempty"`
// KubeVersion is a SemVer constraint specifying the version of Kubernetes required.
KubeVersion string `json:"kubeVersion,omitempty"`
// Dependencies are a list of dependencies for a chart.
Dependencies []*Dependency `json:"dependencies,omitempty"`
// Specifies the chart type: application or library
Type string `json:"type,omitempty"`
}
Metadata for a Chart file. This models the structure of a Chart.yaml file.
type ValidationError ¶
type ValidationError string
ValidationError represents a data validation error.
func ValidationErrorf ¶
func ValidationErrorf(msg string, args ...any) ValidationError
ValidationErrorf takes a message and formatting options and creates a ValidationError
func (ValidationError) Error ¶
func (v ValidationError) Error() string