chart

package
v3.8.1-fptcloud Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const APIVersionV1 = "v1"

APIVersionV1 is the API version number for version 1.

View Source
const APIVersionV2 = "v2"

APIVersionV2 is the API version number for version 2.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRD

type CRD struct {
	// Name is the File.Name for the crd file
	Name string
	// Filename is the File obj Name including (sub-)chart.ChartFullPath
	Filename string
	// File is the File obj for the crd
	File *File
}

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 []*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 []*File `json:"templates"`
	// Values are default config for this chart.
	Values map[string]interface{} `json:"values"`
	// Schema is an optional JSON schema for imposing structure on Values
	Schema []byte `json:"schema"`
	// Files are miscellaneous files in a chart archive,
	// e.g. README, LICENSE, etc.
	Files []*File `json:"files"`
	// 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

func (ch *Chart) AddDependency(charts ...*Chart)

AddDependency determines if the chart is a subchart.

func (*Chart) AppVersion

func (ch *Chart) AppVersion() string

AppVersion returns the appversion of the chart.

func (*Chart) CRDObjects

func (ch *Chart) CRDObjects() []CRD

CRDObjects returns a list of CRD objects in the 'crds/' directory of a Helm chart & subcharts

func (*Chart) CRDs

func (ch *Chart) CRDs() []*File

CRDs returns a list of File objects in the 'crds/' directory of a Helm chart. Deprecated: use CRDObjects()

func (*Chart) ChartFullPath

func (ch *Chart) ChartFullPath() string

ChartFullPath returns the full path to this chart.

func (*Chart) ChartPath

func (ch *Chart) ChartPath() string

ChartPath returns the full path to this chart in dot notation.

func (*Chart) Dependencies

func (ch *Chart) Dependencies() []*Chart

Dependencies are the charts that this chart depends on.

func (*Chart) IsRoot

func (ch *Chart) IsRoot() bool

IsRoot determines if the chart is the root chart.

func (*Chart) Name

func (ch *Chart) Name() string

Name returns the name of the chart.

func (*Chart) Parent

func (ch *Chart) Parent() *Chart

Parent returns a subchart's parent chart.

func (*Chart) Root

func (ch *Chart) Root() *Chart

Root finds the root chart.

func (*Chart) SetDependencies

func (ch *Chart) SetDependencies(charts ...*Chart)

SetDependencies replaces the chart dependencies.

func (*Chart) Validate

func (ch *Chart) Validate() error

Validate validates the metadata.

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"`
	// 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"`
	// 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"`
	// A yaml path that resolves to a boolean, used for enabling/disabling charts (e.g. subchart1.enabled )
	Condition string `json:"condition,omitempty"`
	// Tags can be used to group charts for enabling/disabling together
	Tags []string `json:"tags,omitempty"`
	// Enabled bool determines if chart should be loaded
	Enabled bool `json:"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 []interface{} `json:"import-values,omitempty"`
	// Alias usable alias to be used for the chart
	Alias string `json:"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 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"`
}

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 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.

func (*Metadata) Validate

func (md *Metadata) Validate() error

Validate checks the metadata for known issues and sanitizes string characters.

type ValidationError

type ValidationError string

ValidationError represents a data validation error.

func ValidationErrorf

func ValidationErrorf(msg string, args ...interface{}) ValidationError

ValidationErrorf takes a message and formatting options and creates a ValidationError

func (ValidationError) Error

func (v ValidationError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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