chart

package
Version: v0.0.0-...-6c2d9fc Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2017 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// AnnFile is the annotation key for a file's origin.
	AnnFile = "chart.helm.sh/file"

	// AnnChartVersion is the annotation key for a chart's version.
	AnnChartVersion = "chart.helm.sh/version"

	// AnnChartDesc is the annotation key for a chart's description.
	AnnChartDesc = "chart.helm.sh/description"

	// AnnChartName is the annotation key for a chart name.
	AnnChartName = "chart.helm.sh/name"
)

Variables

This section is empty.

Functions

func RepoName

func RepoName(chartpath string) string

RepoName gets the name of the Git repo, or an empty string if none is found.

Types

type Chart

type Chart struct {
	Chartfile *Chartfile

	// Kind is a map of Kind to an array of manifests.
	//
	// For example, Kind["Pod"] has an array of Pod manifests.
	Kind map[string][]*manifest.Manifest

	// Manifests is an array of Manifest objects.
	Manifests []*manifest.Manifest
}

Chart represents a complete chart.

A chart consists of the following parts:

- Chart.yaml: In code, we refer to this as the Chartfile
- manifests/*.yaml: The Kubernetes manifests

On the Chart object, the manifests are sorted by type into a handful of recognized Kubernetes API v1 objects.

TODO: Investigate treating these as unversioned.

func Load

func Load(chart string) (*Chart, error)

Load loads an entire chart.

This includes the Chart.yaml (*Chartfile) and all of the manifests.

If you are just reading the Chart.yaml file, it is substantially more performant to use LoadChartfile.

func (*Chart) UnknownKinds

func (c *Chart) UnknownKinds(known []string) []string

UnknownKinds returns a list of kinds that this chart contains, but which were not in the passed in array.

A Chart will store all kinds that are given to it. This makes it possible to get a list of kinds that are not known beforehand.

type Chartfile

type Chartfile struct {
	Name         string            `yaml:"name"`
	From         *Dependency       `yaml:"from,omitempty"`
	Home         string            `yaml:"home"`
	Source       []string          `yaml:"source,omitempty"`
	Version      string            `yaml:"version"`
	Description  string            `yaml:"description"`
	Maintainers  []string          `yaml:"maintainers,omitempty"`
	Details      string            `yaml:"details,omitempty"`
	Dependencies []*Dependency     `yaml:"dependencies,omitempty"`
	PreInstall   map[string]string `yaml:"preinstall,omitempty"`
}

Chartfile describes a Helm Chart (e.g. Chart.yaml)

func LoadChartfile

func LoadChartfile(filename string) (*Chartfile, error)

LoadChartfile loads a Chart.yaml file into a *Chart.

func (*Chartfile) Save

func (c *Chartfile) Save(filename string) error

Save saves a Chart.yaml file

type Dependency

type Dependency struct {
	Name    string `yaml:"name"`
	Version string `yaml:"version"`
	Repo    string `yaml:"repo,omitempty"`
}

Dependency describes a specific dependency.

func (*Dependency) VersionOK

func (d *Dependency) VersionOK(version string) bool

VersionOK returns true if the given version meets the constraints.

It returns false if the version string or constraint is unparsable or if the version does not meet the constraint.

Jump to

Keyboard shortcuts

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