helm: github.com/2opremio/helm/chart Index | Files

package chart

import "github.com/2opremio/helm/chart"

Index

Package Files

chart.go chartfile.go

Constants

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"
)

func RepoName Uses

func RepoName(chartpath string) string

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

type Chart Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

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

func (*Chartfile) Save Uses

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

Save saves a Chart.yaml file

type Dependency Uses

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

Dependency describes a specific dependency.

func (*Dependency) VersionOK Uses

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.

Package chart imports 10 packages (graph). Updated 2017-04-27. Refresh now. Tools for package owners. This is a quick bug-fix fork (has fewer than three commits, and only during the week it was created).