helmer

package
v0.0.93 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ChartFileName file name for a chart
	ChartFileName = "Chart.yaml"

	// LabsChartRepository the default charts repo for the labs charts
	LabsChartRepository = "https://storage.googleapis.com/jenkinsxio-labs/charts"
)

Variables

This section is empty.

Functions

func AddHelmRepoIfMissing

func AddHelmRepoIfMissing(helmer Helmer, helmURL, repoName, username, password string) (string, error)

AddHelmRepoIfMissing will add the helm repo if there is no helm repo with that url present. It will generate the repoName from the url (using the host name) if the repoName is empty. The repo name may have a suffix added in order to prevent name collisions, and is returned for this reason. The username and password will be stored in vault for the URL (if vault is enabled).

Types

type ChartSummary

type ChartSummary struct {
	Name         string
	ChartVersion string
	AppVersion   string
	Description  string
}

ChartSummary contains a chart summary

type HelmCLI

type HelmCLI struct {
	Binary string
	CWD    string
	Runner util.Commander
	Debug  bool
}

HelmCLI implements common helm actions based on helm CLI

func NewHelmCLI

func NewHelmCLI(cwd string) *HelmCLI

NewHelmCLI creates a new CLI

func NewHelmCLIWithRunner

func NewHelmCLIWithRunner(runner util.Commander, binary string, cwd string, debug bool) *HelmCLI

NewHelmCLIWithRunner creates a new HelmCLI interface for the given runner

func (*HelmCLI) AddRepo

func (h *HelmCLI) AddRepo(repoName, repoURL, username, password 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) DecryptSecrets

func (h *HelmCLI) DecryptSecrets(location string) error

DecryptSecrets decrypt secrets

func (*HelmCLI) DeleteRelease

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

DeleteRelease removes the given release

func (*HelmCLI) Env

func (h *HelmCLI) Env() map[string]string

Env returns the environment variables for the helmer

func (*HelmCLI) FetchChart

func (h *HelmCLI) FetchChart(chart string, version string, untar bool, untardir string, repo string,
	username string, password string) error

FetchChart fetches a Helm Chart

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, valueStrings []string, valueFiles []string, repo string, username string, password string) error

InstallChart installs a helm chart according with the given flags

func (*HelmCLI) IsRepoMissing

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

IsRepoMissing checks if the repository with the given URL is missing from helm. If the repo is found, the name of the repo will be returned

func (*HelmCLI) Lint

func (h *HelmCLI) Lint(valuesFiles []string) (string, error)

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

func (*HelmCLI) ListReleases

func (h *HelmCLI) ListReleases(ns string) (map[string]ReleaseSummary, []string, error)

ListReleases lists the releases in ns

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

func (h *HelmCLI) SearchCharts(filter string, allVersions bool) ([]ChartSummary, error)

SearchCharts searches for all the charts matching the given filter

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(ns string, releaseName string) error

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

func (*HelmCLI) StatusReleaseWithOutput

func (h *HelmCLI) StatusReleaseWithOutput(ns string, releaseName string, outputFormat string) (string, error)

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

func (*HelmCLI) Template

func (h *HelmCLI) Template(chart string, releaseName string, ns string, outDir string, upgrade bool,
	values []string, valueStrings []string, valueFiles []string) error

Template generates the YAML from the chart template to the given directory

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, valueStrings []string, valueFiles []string, repo string, username string, password 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

func (*HelmCLI) VersionWithArgs

func (h *HelmCLI) VersionWithArgs(tls bool, extraArgs ...string) (string, error)

VersionWithArgs executes the helm version command and returns its output

type Helmer

type Helmer interface {
	SetCWD(dir string)
	HelmBinary() string
	AddRepo(repo, URL, username, password string) error
	RemoveRepo(repo string) error
	ListRepos() (map[string]string, error)
	UpdateRepo() error
	IsRepoMissing(URL string) (bool, string, error)
	RemoveRequirementsLock() error
	BuildDependency() error
	InstallChart(chart string, releaseName string, ns string, version string, timeout int,
		values []string, valueStrings []string, valueFiles []string, repo string, username string, password string) error
	UpgradeChart(chart string, releaseName string, ns string, version string, install bool, timeout int, force bool, wait bool,
		values []string, valueStrings []string, valueFiles []string, repo string, username string, password string) error
	FetchChart(chart string, version string, untar bool, untardir string, repo string, username string,
		password string) error
	DeleteRelease(ns string, releaseName string, purge bool) error
	ListReleases(ns string) (map[string]ReleaseSummary, []string, error)
	FindChart() (string, error)
	PackageChart() error
	StatusRelease(ns string, releaseName string) error
	StatusReleaseWithOutput(ns string, releaseName string, format string) (string, error)
	Lint(valuesFiles []string) (string, error)
	Version(tls bool) (string, error)
	SearchCharts(filter string, allVersions bool) ([]ChartSummary, error)
	Env() map[string]string
	DecryptSecrets(location string) error
	Template(chartDir string, releaseName string, ns string, outputDir string, upgrade bool, values []string, valueStrings []string, valueFiles []string) error
}

Helmer defines common helm actions used within Jenkins X

type ReleaseSummary

type ReleaseSummary struct {
	ReleaseName   string
	Revision      string
	Updated       string
	Status        string
	ChartFullName string
	Chart         string
	ChartVersion  string
	AppVersion    string
	Namespace     string
}

ReleaseSummary is the information about a release in Helm

Jump to

Keyboard shortcuts

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