Documentation
¶
Index ¶
Examples ¶
Constants ¶
const GlobalKey = "global"
GlobalKey is the name of the Values key that is used for storing global vars.
Variables ¶
var ( // DefaultVersionSet is the default version set, which includes only Core V1 ("v1"). DefaultVersionSet = allKnownVersions() DefaultCapabilities = func() *Capabilities { caps, err := makeDefaultCapabilities() if err != nil { panic(fmt.Sprintf("failed to create default capabilities: %v", err)) } return caps }() )
Functions ¶
This section is empty.
Types ¶
type Capabilities ¶
type Capabilities struct {
// KubeVersion is the Kubernetes version.
KubeVersion KubeVersion
// APIVersions are supported Kubernetes API versions.
APIVersions VersionSet
// HelmVersion is the build information for this helm version
HelmVersion helmversion.BuildInfo
}
Capabilities describes the capabilities of the Kubernetes cluster.
func (*Capabilities) Copy ¶
func (capabilities *Capabilities) Copy() *Capabilities
type ErrInvalidChartName ¶
type ErrInvalidChartName struct {
Name string
}
func (ErrInvalidChartName) Error ¶
func (e ErrInvalidChartName) Error() string
type ErrNoTable ¶
type ErrNoTable struct {
Key string
}
ErrNoTable indicates that a chart does not have a matching table.
func (ErrNoTable) Error ¶
func (e ErrNoTable) Error() string
type ErrNoValue ¶
type ErrNoValue struct {
Key string
}
ErrNoValue indicates that Values does not contain a key with a value
func (ErrNoValue) Error ¶
func (e ErrNoValue) Error() string
type File ¶
type File struct {
// Name is the path-like name of the template.
Name string `json:"name"`
// Data is the template as byte data.
Data []byte `json:"data"`
// ModTime is the file's mod-time
ModTime time.Time `json:"modtime,omitzero"`
}
File represents a file as a name/value pair.
By convention, name is a relative path within the scope of the chart's base directory.
type KubeVersion ¶
type KubeVersion struct {
Version string // Full version (e.g., v1.33.4-gke.1245000)
Major string // Kubernetes major version
Minor string // Kubernetes minor version
// contains filtered or unexported fields
}
KubeVersion is the Kubernetes version.
func ParseKubeVersion ¶
func ParseKubeVersion(version string) (*KubeVersion, error)
ParseKubeVersion parses kubernetes version from string
func (*KubeVersion) GitVersion
deprecated
func (kv *KubeVersion) GitVersion() string
GitVersion returns the full Kubernetes version string.
Deprecated: use KubeVersion.Version.
func (*KubeVersion) String ¶
func (kv *KubeVersion) String() string
String implements fmt.Stringer. Returns the normalized version used for constraint checking.
type ReleaseOptions ¶
type ReleaseOptions struct {
Name string
Namespace string
Revision int
IsUpgrade bool
IsInstall bool
}
ReleaseOptions represents the additional release options needed for the composition of the final values struct
type RuntimeData ¶
type RuntimeData interface {
DecodeAndLoadSecrets(ctx context.Context, loadedChartFiles []*nelmcommon.BufferedFile, secretsManager *secrets_manager.SecretsManager, opts DecodeAndLoadSecretsOptions) error
GetDecryptedSecretValues() map[string]interface{}
GetDecryptedSecretFilesData() map[string]string
}
type Values ¶
Values represents a collection of chart values.
Example ¶
doc := `
title: "Moby Dick"
chapter:
one:
title: "Loomings"
two:
title: "The Carpet-Bag"
three:
title: "The Spouter Inn"
`
d, err := ReadValues([]byte(doc))
if err != nil {
panic(err)
}
ch1, err := d.Table("chapter.one")
if err != nil {
panic("could not find chapter one")
}
fmt.Print(ch1["title"])
Output: Loomings
func ReadValues ¶
ReadValues will parse YAML byte data into a Values.
func ReadValuesFile ¶
ReadValuesFile will parse a YAML file into a map of values.
func (Values) AsMap ¶
AsMap is a utility function for converting Values to a map[string]interface{}.
It protects against nil map panics.
func (Values) PathValue ¶
PathValue takes a path that traverses a YAML structure and returns the value at the end of that path. The path starts at the root of the YAML structure and is comprised of YAML keys separated by periods. Given the following YAML data the value at path "chapter.one.title" is "Loomings".
chapter:
one:
title: "Loomings"
type VersionSet ¶
type VersionSet []string
VersionSet is a set of Kubernetes API versions.
func (VersionSet) Has ¶
func (v VersionSet) Has(apiVersion string) bool
Has returns true if the version string is in the set.
vs.Has("apps/v1")