helm

package
v1.3.85 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequirementsFileName = "requirements.yaml"

	DefaultHelmRepositoryURL = "http://jenkins-x-chartmuseum:8080"
)

Variables

This section is empty.

Functions

func FindRequirementsFileName

func FindRequirementsFileName(dir string) (string, error)

FindRequirementsFileName returns the default requirements.yaml file name

func LoadChartName

func LoadChartName(chartFile string) (string, error)

func LoadChartNameAndVersion

func LoadChartNameAndVersion(chartFile string) (string, string, error)

func SaveRequirementsFile

func SaveRequirementsFile(fileName string, requirements *Requirements) error

SaveRequirementsFile saves the requirements file

Types

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.

type ErrNoRequirementsFile

type ErrNoRequirementsFile error

ErrNoRequirementsFile to detect error condition

type HelmCLI

type HelmCLI struct {
	Binary     string
	BinVersion Version
	CWD        string
	// contains filtered or unexported fields
}

HelmCLI implements common helm actions based on helm CLI

func NewHelmCLI

func NewHelmCLI(binary string, version Version, cwd string) *HelmCLI

NewHelmCLI creates a new HelmCLI instance configured to used the provided helm CLI in the given current working directory

func (*HelmCLI) AddRepo

func (h *HelmCLI) AddRepo(repo string, URL string) error

AddRepo adds a new helm repo with the given name and URL

func (*HelmCLI) BuildDependency

func (h *HelmCLI) BuildDependency() error

BuildDependency builds the helm dependencies of the helm chart from the current working directory

func (*HelmCLI) DeleteRelease

func (h *HelmCLI) DeleteRelease(releaseName string, purge bool) error

DeleteRelease removes the given release

func (*HelmCLI) FindChart

func (h *HelmCLI) FindChart() (string, error)

FindChart find a chart in the current working directory, if no chart file is found an error is returned

func (*HelmCLI) HelmBinary

func (h *HelmCLI) HelmBinary() string

HelmBinary return the configured helm CLI

func (*HelmCLI) Init

func (h *HelmCLI) Init(clientOnly bool, serviceAccount string, tillerNamespace string, upgrade bool) error

Init executes the helm init command according with the given flags

func (*HelmCLI) InstallChart

func (h *HelmCLI) InstallChart(chart string, releaseName string, ns string, version *string, timeout *int,
	values []string, valueFiles []string) error

InstallChart installs a helm chart according with the given flags

func (*HelmCLI) IsRepoMissing

func (h *HelmCLI) IsRepoMissing(URL string) (bool, error)

IsRepoMissing checks if the repository with the given URL is missing from helm

func (*HelmCLI) Lint

func (h *HelmCLI) Lint() (string, error)

Lint lints the helm chart from the current working directory and returns the warnings in the output

func (*HelmCLI) ListCharts

func (h *HelmCLI) ListCharts() (string, error)

ListCharts execute the helm list command and returns its output

func (*HelmCLI) ListRepos

func (h *HelmCLI) ListRepos() (map[string]string, error)

ListRepos list the installed helm repos together with their URL

func (*HelmCLI) PackageChart

func (h *HelmCLI) PackageChart() error

PackageChart packages the chart from the current working directory

func (*HelmCLI) RemoveRepo

func (h *HelmCLI) RemoveRepo(repo string) error

RemoveRepo removes the given repo from helm

func (*HelmCLI) RemoveRequirementsLock

func (h *HelmCLI) RemoveRequirementsLock() error

RemoveRequirementsLock removes the requirements.lock file from the current working directory

func (*HelmCLI) SearchChartVersions

func (h *HelmCLI) SearchChartVersions(chart string) ([]string, error)

SearchChartVersions search all version of the given chart

func (*HelmCLI) SetCWD

func (h *HelmCLI) SetCWD(dir string)

SetCWD configures the common working directory of helm CLI

func (*HelmCLI) SetHelmBinary

func (h *HelmCLI) SetHelmBinary(binary string)

SetHelmBinary configure a new helm CLI

func (*HelmCLI) StatusRelease

func (h *HelmCLI) StatusRelease(releaseName string) error

StatusRelease returns the output of the helm status command for a given release

func (*HelmCLI) StatusReleases

func (h *HelmCLI) StatusReleases() (map[string]string, error)

StatusReleases returns the status of all installed releases

func (*HelmCLI) UpdateRepo

func (h *HelmCLI) UpdateRepo() error

UpdateRepo updates the helm repositories

func (*HelmCLI) UpgradeChart

func (h *HelmCLI) UpgradeChart(chart string, releaseName string, ns string, version *string, install bool,
	timeout *int, force bool, wait bool, values []string, valueFiles []string) error

UpgradeChart upgrades a helm chart according with given helm flags

func (*HelmCLI) Version

func (h *HelmCLI) Version(tls bool) (string, error)

Version executes the helm version command and returns its output

type HelmFake

type HelmFake struct {
	// contains filtered or unexported fields
}

func NewHelmFake

func NewHelmFake(binary string, version Version, cwd string, output string) *HelmFake

func (*HelmFake) AddRepo

func (h *HelmFake) AddRepo(repo string, URL string) error

func (*HelmFake) BuildDependency

func (h *HelmFake) BuildDependency() error

func (*HelmFake) DeleteRelease

func (h *HelmFake) DeleteRelease(releaseName string, purge bool) error

func (*HelmFake) FindChart

func (h *HelmFake) FindChart() (string, error)

func (*HelmFake) HelmBinary

func (h *HelmFake) HelmBinary() string

func (*HelmFake) Init

func (h *HelmFake) Init(clientOnly bool, serviceAccount string, tillerNamespace string, upgrade bool) error

func (*HelmFake) InstallChart

func (h *HelmFake) InstallChart(chart string, releaseName string, ns string, version *string,
	timeout *int, values []string, valueFiles []string) error

func (*HelmFake) IsRepoMissing

func (h *HelmFake) IsRepoMissing(URL string) (bool, error)

func (*HelmFake) Lint

func (h *HelmFake) Lint() (string, error)

func (*HelmFake) ListCharts

func (h *HelmFake) ListCharts() (string, error)

func (*HelmFake) ListRepos

func (h *HelmFake) ListRepos() (map[string]string, error)

func (*HelmFake) PackageChart

func (h *HelmFake) PackageChart() error

func (*HelmFake) RemoveRepo

func (h *HelmFake) RemoveRepo(repo string) error

func (*HelmFake) RemoveRequirementsLock

func (h *HelmFake) RemoveRequirementsLock() error

func (*HelmFake) SearchChartVersions

func (h *HelmFake) SearchChartVersions(chart string) ([]string, error)

func (*HelmFake) SetCWD

func (h *HelmFake) SetCWD(dir string)

func (*HelmFake) SetHelmBinary

func (h *HelmFake) SetHelmBinary(binary string)

func (*HelmFake) SetOutput

func (h *HelmFake) SetOutput(output string)

func (*HelmFake) StatusRelease

func (h *HelmFake) StatusRelease(releaseName string) error

func (*HelmFake) StatusReleases

func (h *HelmFake) StatusReleases() (map[string]string, error)

func (*HelmFake) UpdateRepo

func (h *HelmFake) UpdateRepo() error

func (*HelmFake) UpgradeChart

func (h *HelmFake) UpgradeChart(chart string, releaseName string, ns string, version *string,
	install bool, timeout *int, force bool, wait bool, values []string, valueFiles []string) error

func (*HelmFake) Version

func (h *HelmFake) Version(tls bool) (string, error)

type Helmer

type Helmer interface {
	SetCWD(dir string)
	HelmBinary() string
	SetHelmBinary(binary string)
	Init(clientOnly bool, serviceAccount string, tillerNamespace string, upgrade bool) error
	AddRepo(repo string, URL string) error
	RemoveRepo(repo string) error
	ListRepos() (map[string]string, error)
	UpdateRepo() error
	IsRepoMissing(URL string) (bool, error)
	RemoveRequirementsLock() error
	BuildDependency() error
	InstallChart(chart string, releaseName string, ns string, version *string, timeout *int,
		values []string, valueFiles []string) error
	UpgradeChart(chart string, releaseName string, ns string, version *string, install bool,
		timeout *int, force bool, wait bool, values []string, valueFiles []string) error
	DeleteRelease(releaseName string, purge bool) error
	ListCharts() (string, error)
	SearchChartVersions(chart string) ([]string, error)
	FindChart() (string, error)
	PackageChart() error
	StatusRelease(releaseName string) error
	StatusReleases() (map[string]string, error)
	Lint() (string, error)
	Version(tls bool) (string, error)
}

Helmer defines common helm actions used within Jenkins X

type Requirements

type Requirements struct {
	Dependencies []*Dependency `json:"dependencies"`
}

Requirements is a list of requirements for a chart.

Requirements are charts upon which this chart depends. This expresses developer intent.

func LoadRequirements

func LoadRequirements(data []byte) (*Requirements, error)

LoadRequirements loads the requirements from some data

func LoadRequirementsFile

func LoadRequirementsFile(fileName string) (*Requirements, error)

LoadRequirementsFile loads the requirements file or creates empty requirements if the file does not exist

func (*Requirements) RemoveApp

func (r *Requirements) RemoveApp(app string) bool

RemoveApp removes the given app name. Returns true if a dependency was removed

func (*Requirements) SetAppVersion

func (r *Requirements) SetAppVersion(app string, version string, repository string)

SetAppVersion sets the version of the app to use

type Version

type Version int

Version defines the helm version

const (
	V2 Version = 2
	V3         = 3
)

Jump to

Keyboard shortcuts

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