jx: github.com/jenkins-x/jx/pkg/helm Index | Files | Directories

package helm

import "github.com/jenkins-x/jx/pkg/helm"

Index

Package Files

helm.go helm_cli.go helm_helpers.go helm_template.go interface.go tiller.go values_tree.go

Constants

const (
    // ChartFileName file name for a chart
    ChartFileName = "Chart.yaml"
    // RequirementsFileName the file name for helm requirements
    RequirementsFileName = "requirements.yaml"
    // SecretsFileName the file name for secrets
    SecretsFileName = "secrets.yaml"
    // ValuesFileName the file name for values
    ValuesFileName = "values.yaml"
    // ValuesTemplateFileName a templated values.yaml file which can refer to parameter expressions
    ValuesTemplateFileName = "values.tmpl.yaml"
    // TemplatesDirName is the default name for the templates directory
    TemplatesDirName = "templates"

    // ParametersYAMLFile contains logical parameters (values or secrets) which can be fetched from a Secret URL or
    // inlined if not a secret which can be referenced from a 'values.yaml` file via a `{{ .Parameters.foo.bar }}` expression
    ParametersYAMLFile = "parameters.yaml"

    // InClusterHelmRepositoryURL is the default cluster local helm repo
    InClusterHelmRepositoryURL = "http://jenkins-x-chartmuseum:8080"

    // FakeChartmusuem is the url for the fake chart museum used in tests
    FakeChartmusuem = "http://fake.chartmuseum"

    // DefaultEnvironmentChartDir is the default environment path where charts are stored
    DefaultEnvironmentChartDir = "env"

    //RepoVaultPath is the path to the repo credentials in Vault
    RepoVaultPath = "helm/repos"
)
const (
    // AnnotationChartName stores the chart name
    AnnotationChartName = "jenkins.io/chart"
    // AnnotationAppVersion stores the chart's app version
    AnnotationAppVersion = "jenkins.io/chart-app-version"
    // AnnotationAppDescription stores the chart's app version
    AnnotationAppDescription = "jenkins.io/chart-description"
    // AnnotationAppRepository stores the chart's app repository
    AnnotationAppRepository = "jenkins.io/chart-repository"

    // LabelReleaseName stores the chart release name
    LabelReleaseName = "jenkins.io/chart-release"

    // LabelNamespace stores the chart namespace for cluster wide resources
    LabelNamespace = "jenkins.io/namespace"

    // LabelReleaseChartVersion stores the version of a chart installation in a label
    LabelReleaseChartVersion = "jenkins.io/version"
    // LabelAppName stores the chart's app name
    LabelAppName = "jenkins.io/app-name"
    // LabelAppVersion stores the chart's app version
    LabelAppVersion = "jenkins.io/app-version"
)

Variables

var DefaultValuesTreeIgnores = []string{
    "templates/*",
}

DefaultValuesTreeIgnores is the default set of ignored files for collapsing the values tree which are used if ignores is nil

func AddHelmRepoIfMissing Uses

func AddHelmRepoIfMissing(helmURL, repoName, username, password string, helmer Helmer,
    secretURLClient secreturl.Client, in terminal.FileReader,
    out terminal.FileWriter, outErr io.Writer) (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).

func AppendMyValues Uses

func AppendMyValues(valueFiles []string) ([]string, error)

func CombineValueFilesToFile Uses

func CombineValueFilesToFile(outFile string, inputFiles []string, chartName string, extraValues map[string]interface{}) error

CombineValueFilesToFile iterates through the input files and combines them into a single Values object and then write it to the output file nested inside the chartName

func DecorateWithCredentials Uses

func DecorateWithCredentials(repo string, username string, password string, secretURLClient secreturl.Client, in terminal.FileReader,
    out terminal.FileWriter, outErr io.Writer) (string,
    string, error)

DecorateWithCredentials will, if vault is installed, store or replace the username or password

func DecorateWithSecrets Uses

func DecorateWithSecrets(valueFiles []string, secretURLClient secreturl.Client) ([]string, func(), error)

DecorateWithSecrets will replace any vault: URIs with the secret from vault. Safe to call with a nil client ( no replacement will take place).

func FindChartFileName Uses

func FindChartFileName(dir string) (string, error)

FindChartFileName returns the default chart.yaml file name

func FindRequirementsFileName Uses

func FindRequirementsFileName(dir string) (string, error)

FindRequirementsFileName returns the default requirements.yaml file name

func FindTemplatesDirName Uses

func FindTemplatesDirName(dir string) (string, error)

FindTemplatesDirName returns the default templates/ dir name

func FindValuesFileName Uses

func FindValuesFileName(dir string) (string, error)

FindValuesFileName returns the default values.yaml file name

func FindValuesFileNameForChart Uses

func FindValuesFileNameForChart(dir string, chartName string) (string, error)

FindValuesFileNameForChart returns the values.yaml file name for a given chart within the environment or the default if the chart name is empty

func GenerateReadmeForChart Uses

func GenerateReadmeForChart(name string, version string, description string, chartRepo string,
    gitRepo string, releaseNotesURL string, appReadme string) string

GenerateReadmeForChart generates a string that can be used as a README.MD, and includes info on the chart.

func GenerateValues Uses

func GenerateValues(requirements *config.RequirementsConfig, funcMap template.FuncMap, dir string, ignores []string, verbose bool, secretURLClient secreturl.Client) ([]byte, chartutil.Values, error)

GenerateValues will generate a values.yaml file in dir. It scans all subdirectories for values.yaml files, and merges them into the values.yaml in the root directory, creating a nested key structure that matches the directory structure. Any keys used that match files with the same name in the directory ( and have empty values) will be inlined as block scalars. Standard UNIX glob patterns can be passed to IgnoreFile directories.

func GetTillerAddress Uses

func GetTillerAddress() string

GetTillerAddress returns the address that tiller is listening on

func HandleExternalFileRefs Uses

func HandleExternalFileRefs(element interface{}, possibles map[string]string, jsonPath string,
    handler func(path string, element map[string]interface{}, key string) error) error

HandleExternalFileRefs recursively scans the element map structure, looking for nested maps. If it finds keys that match any key-value pair in possibles it will call the handler. The jsonPath is used for referencing the path in the map structure when reporting errors.

func InspectChart Uses

func InspectChart(chart string, version string, repo string, username string, password string,
    helmer Helmer, inspector func(dir string) error) error

InspectChart fetches the specified chart in a repo using helmer, and then calls the closure on it, before cleaning up

func InstallFromChartOptions Uses

func InstallFromChartOptions(options InstallChartOptions, helmer Helmer, kubeClient kubernetes.Interface,
    installTimeout string, secretURLClient secreturl.Client) error

InstallFromChartOptions uses the helmer and kubeClient interfaces to install the chart from the options, respecting the installTimeout, looking up or updating Vault with the username and password for the repo. If secretURLClient is nil then username and passwords for repos will not be looked up in Vault.

func IsLocal Uses

func IsLocal(chart string) bool

IsLocal returns whether this chart is being installed from the local filesystem or not

func LoadChart Uses

func LoadChart(data []byte) (*chart.Metadata, error)

LoadChart loads the requirements from some data

func LoadChartFile Uses

func LoadChartFile(fileName string) (*chart.Metadata, error)

LoadChartFile loads the chart file or creates empty chart if the file does not exist

func LoadChartName Uses

func LoadChartName(chartFile string) (string, error)

func LoadChartNameAndVersion Uses

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

func LoadParameters Uses

func LoadParameters(dir string, secretURLClient secreturl.Client) (chartutil.Values, error)

LoadParameters loads the 'parameters.yaml' file if it exists in the current directory

func LoadParametersValuesFile Uses

func LoadParametersValuesFile(dir string) (map[string]interface{}, error)

LoadParametersValuesFile loads the parameters values file or creates empty map if the file does not exist

func LoadTemplatesDir Uses

func LoadTemplatesDir(dirName string) (map[string]string, error)

LoadTemplatesDir loads the files in the templates dir or creates empty map if none exist

func LoadValues Uses

func LoadValues(data []byte) (map[string]interface{}, error)

LoadValues loads the values from some data

func LoadValuesFile Uses

func LoadValuesFile(fileName string) (map[string]interface{}, error)

LoadValuesFile loads the values file or creates empty map if the file does not exist

func ModifyChart Uses

func ModifyChart(chartFile string, fn func(chart *chart.Metadata) error) error

ModifyChart modifies the given chart using a callback

func NewFunctionMap Uses

func NewFunctionMap() template.FuncMap

NewFunctionMap creates a new function map for values.tmpl.yaml templating

func PromptForRepoCredsIfNeeded Uses

func PromptForRepoCredsIfNeeded(repo string, cred *HelmRepoCredential, in terminal.FileReader,
    out terminal.FileWriter, outErr io.Writer) error

PromptForRepoCredsIfNeeded will prompt for repo credentials if required. It first checks the existing cred ( if any) and then prompts for new credentials up to 3 times, trying each set.

func ReadValuesYamlFileTemplateOutput Uses

func ReadValuesYamlFileTemplateOutput(templateFile string, params chartutil.Values, funcMap template.FuncMap, requirements *config.RequirementsConfig) ([]byte, error)

ReadValuesYamlFileTemplateOutput evaluates the given values.yaml file as a go template and returns the output data

func RenderReleasesAsTable Uses

func RenderReleasesAsTable(releases map[string]ReleaseSummary, sortedKeys []string) (string, error)

RenderReleasesAsTable lists the current releases in a table

func RestartLocalTiller Uses

func RestartLocalTiller() error

RestartLocalTiller resttarts locall tiller

func SaveFile Uses

func SaveFile(fileName string, contents interface{}) error

SaveFile saves contents (a pointer to a data structure) to a file

func SetChartVersion Uses

func SetChartVersion(chartFile string, version string) error

SetChartVersion modifies the given chart file to update the version

func SetValuesToMap Uses

func SetValuesToMap(setValues []string) map[string]interface{}

SetValuesToMap converts the set of values of the form "foo.bar=123" into a helm values.yaml map structure

func StartLocalTiller Uses

func StartLocalTiller(lazy bool) error

StartLocalTiller starts local tiller server

func StartLocalTillerIfNotRunning Uses

func StartLocalTillerIfNotRunning() error

StartLocalTillerIfNotRunning starts local tiller if not running

func UpdateImagesInValuesToNewVersion Uses

func UpdateImagesInValuesToNewVersion(data []byte, name string, newVersion string) ([]byte, []string)

UpdateImagesInValuesToNewVersion update a (values) file, replacing that start with "Image: <name>:" to "Image: <name>:<newVersion>", returning the oldVersions

func UpdateRequirementsToNewVersion Uses

func UpdateRequirementsToNewVersion(requirements *Requirements, name string, newVersion string) []string

UpdateRequirementsToNewVersion update dependencies with name to newVersion, returning the oldVersions

type ChartSummary Uses

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

func FindLatestChart Uses

func FindLatestChart(name string, helmer Helmer) (*ChartSummary, error)

FindLatestChart uses helmer to find the latest chart for name

type DepSorter Uses

type DepSorter []*Dependency

DepSorter Used to avoid merge conflicts by sorting deps by name

func (DepSorter) Len Uses

func (a DepSorter) Len() int

func (DepSorter) Less Uses

func (a DepSorter) Less(i, j int) bool

func (DepSorter) Swap Uses

func (a DepSorter) Swap(i, j int)

type Dependency Uses

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 Uses

type ErrNoRequirementsFile error

ErrNoRequirementsFile to detect error condition

type HelmCLI Uses

type HelmCLI struct {
    Binary     string
    BinVersion Version
    CWD        string
    Runner     util.Commander
    Debug      bool
    // contains filtered or unexported fields
}

HelmCLI implements common helm actions based on helm CLI

func NewHelmCLI Uses

func NewHelmCLI(binary string, version Version, cwd string, debug bool, args ...string) *HelmCLI

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

func NewHelmCLIWithRunner Uses

func NewHelmCLIWithRunner(runner util.Commander, binary string, version Version, cwd string, debug bool, kuber kube.Kuber) *HelmCLI

NewHelmCLIWithRunner creates a new HelmCLI interface for the given runner

func (*HelmCLI) AddRepo Uses

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

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

func (*HelmCLI) BuildDependency Uses

func (h *HelmCLI) BuildDependency() error

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

func (*HelmCLI) DecryptSecrets Uses

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

func (*HelmCLI) DeleteRelease Uses

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

DeleteRelease removes the given release

func (*HelmCLI) Env Uses

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

Env returns the environment variables for the helmer

func (*HelmCLI) FetchChart Uses

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 Uses

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 Uses

func (h *HelmCLI) HelmBinary() string

HelmBinary return the configured helm CLI

func (*HelmCLI) Init Uses

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 Uses

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

InstallChart installs a helm chart according with the given flags

func (*HelmCLI) IsRepoMissing Uses

func (h *HelmCLI) IsRepoMissing(URL 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) Kube Uses

func (h *HelmCLI) Kube() kube.Kuber

Kube returns the k8s config client

func (*HelmCLI) Lint Uses

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 Uses

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

ListReleases lists the releases in ns

func (*HelmCLI) ListRepos Uses

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

ListRepos list the installed helm repos together with their URL

func (*HelmCLI) PackageChart Uses

func (h *HelmCLI) PackageChart() error

PackageChart packages the chart from the current working directory

func (*HelmCLI) RemoveRepo Uses

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

RemoveRepo removes the given repo from helm

func (*HelmCLI) RemoveRequirementsLock Uses

func (h *HelmCLI) RemoveRequirementsLock() error

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

func (*HelmCLI) SearchCharts Uses

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

SearchCharts searches for all the charts matching the given filter

func (*HelmCLI) SetCWD Uses

func (h *HelmCLI) SetCWD(dir string)

SetCWD configures the common working directory of helm CLI

func (*HelmCLI) SetHelmBinary Uses

func (h *HelmCLI) SetHelmBinary(binary string)

SetHelmBinary configure a new helm CLI

func (*HelmCLI) SetHost Uses

func (h *HelmCLI) SetHost(tillerAddress string)

SetHost is used to point at a locally running tiller

func (*HelmCLI) SetKube Uses

func (h *HelmCLI) SetKube(kuber kube.Kuber)

SetKube sets the kube config client

func (*HelmCLI) StatusRelease Uses

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 Uses

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 Uses

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

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

func (*HelmCLI) UpdateRepo Uses

func (h *HelmCLI) UpdateRepo() error

UpdateRepo updates the helm repositories

func (*HelmCLI) UpgradeChart Uses

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

UpgradeChart upgrades a helm chart according with given helm flags

func (*HelmCLI) Version Uses

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

Version executes the helm version command and returns its output

func (*HelmCLI) VersionWithArgs Uses

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

VersionWithArgs executes the helm version command and returns its output

type HelmHook Uses

type HelmHook struct {
    Kind               string
    Name               string
    File               string
    Hooks              []string
    HookDeletePolicies []string
}

func MatchingHooks Uses

func MatchingHooks(hooks []*HelmHook, hook string, hookDeletePolicy string) []*HelmHook

MatchingHooks returns the matching files which have the given hook name and if hookPolicy is not blank the hook policy too

func NewHelmHook Uses

func NewHelmHook(kind string, name string, file string, hook string, hookDeletePolicy string) *HelmHook

NewHelmHook returns a newly created HelmHook

type HelmRepoCredential Uses

type HelmRepoCredential struct {
    Username string `json:"username"`
    Password string `json:"password"`
}

HelmRepoCredential is a username and password pair that can ben used to authenticated against a Helm repo

type HelmRepoCredentials Uses

type HelmRepoCredentials map[string]HelmRepoCredential

HelmRepoCredentials is a map of repositories to HelmRepoCredential that stores all the helm repo credentials for the cluster

type HelmTemplate Uses

type HelmTemplate struct {
    Client          *HelmCLI
    WorkDir         string
    CWD             string
    Binary          string
    Runner          util.Commander
    KubectlValidate bool
    KubeClient      kubernetes.Interface
    Namespace       string
}

HelmTemplate implements common helm actions but purely as client side operations delegating a separate Helmer such as HelmCLI for the client side operations

func NewHelmTemplate Uses

func NewHelmTemplate(client *HelmCLI, workDir string, kubeClient kubernetes.Interface, ns string) *HelmTemplate

NewHelmTemplate creates a new HelmTemplate instance configured to the given client side Helmer

func (*HelmTemplate) AddRepo Uses

func (h *HelmTemplate) AddRepo(repo, URL, username, password string) error

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

func (*HelmTemplate) BuildDependency Uses

func (h *HelmTemplate) BuildDependency() error

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

func (*HelmTemplate) DecryptSecrets Uses

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

func (*HelmTemplate) DeleteRelease Uses

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

DeleteRelease removes the given release

func (*HelmTemplate) Env Uses

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

Env returns the environment variables for the helmer

func (*HelmTemplate) FetchChart Uses

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

FetchChart fetches a Helm Chart

func (*HelmTemplate) FindChart Uses

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

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

func (*HelmTemplate) HelmBinary Uses

func (h *HelmTemplate) HelmBinary() string

HelmBinary return the configured helm CLI

func (*HelmTemplate) Init Uses

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

Init executes the helm init command according with the given flags

func (*HelmTemplate) InstallChart Uses

func (h *HelmTemplate) InstallChart(chart string, releaseName string, ns string, version string, timeout int,
    values []string, valueFiles []string, repo string, username string, password string) error

InstallChart installs a helm chart according with the given flags

func (*HelmTemplate) IsRepoMissing Uses

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

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

func (*HelmTemplate) Lint Uses

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

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

func (*HelmTemplate) ListReleases Uses

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

ListReleases lists the releases in ns

func (*HelmTemplate) ListRepos Uses

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

ListRepos list the installed helm repos together with their URL

func (*HelmTemplate) PackageChart Uses

func (h *HelmTemplate) PackageChart() error

PackageChart packages the chart from the current working directory

func (*HelmTemplate) RemoveRepo Uses

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

RemoveRepo removes the given repo from helm

func (*HelmTemplate) RemoveRequirementsLock Uses

func (h *HelmTemplate) RemoveRequirementsLock() error

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

func (*HelmTemplate) SearchCharts Uses

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

SearchCharts searches for all the charts matching the given filter

func (*HelmTemplate) SetCWD Uses

func (h *HelmTemplate) SetCWD(dir string)

SetCWD configures the common working directory of helm CLI

func (*HelmTemplate) SetHelmBinary Uses

func (h *HelmTemplate) SetHelmBinary(binary string)

SetHelmBinary configure a new helm CLI

func (*HelmTemplate) SetHost Uses

func (h *HelmTemplate) SetHost(tillerAddress string)

SetHost is used to point at a locally running tiller

func (*HelmTemplate) StatusRelease Uses

func (h *HelmTemplate) StatusRelease(ns string, releaseName string) error

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

func (*HelmTemplate) StatusReleaseWithOutput Uses

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

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

func (*HelmTemplate) Template Uses

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

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

func (*HelmTemplate) UpdateRepo Uses

func (h *HelmTemplate) UpdateRepo() error

UpdateRepo updates the helm repositories

func (*HelmTemplate) UpgradeChart Uses

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

UpgradeChart upgrades a helm chart according with given helm flags

func (*HelmTemplate) Version Uses

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

Version executes the helm version command and returns its output

type Helmer Uses

type Helmer interface {
    SetCWD(dir string)
    HelmBinary() string
    SetHelmBinary(binary string)
    Init(clientOnly bool, serviceAccount string, tillerNamespace string, upgrade bool) error
    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, 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, 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)
    SetHost(host string)
    Env() map[string]string
    DecryptSecrets(location string) error
    Template(chartDir string, releaseName string, ns string, outputDir string, upgrade bool, values []string, valueFiles []string) error
}

Helmer defines common helm actions used within Jenkins X go:generate pegomock generate github.com/jenkins-x/jx/pkg/helm Helmer -o mocks/helmer.go

type InstallChartOptions Uses

type InstallChartOptions struct {
    Dir            string
    ReleaseName    string
    Chart          string
    Version        string
    Ns             string
    HelmUpdate     bool
    SetValues      []string
    ValueFiles     []string
    Repository     string
    Username       string
    Password       string
    VersionsDir    string
    VersionsGitURL string
    VersionsGitRef string
    InstallOnly    bool
    NoForce        bool
    Wait           bool
    UpgradeOnly    bool
}

func (*InstallChartOptions) DecorateWithSecrets Uses

func (options *InstallChartOptions) DecorateWithSecrets(secretURLClient secreturl.Client) (func(), error)

DecorateWithSecrets will replace any vault: URIs with the secret from vault. Safe to call with a nil client ( no replacement will take place).

type ReleaseSummary Uses

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

type Requirements Uses

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 Uses

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

LoadRequirements loads the requirements from some data

func LoadRequirementsFile Uses

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

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

func (*Requirements) RemoveApplication Uses

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

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

func (*Requirements) SetAppVersion Uses

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

SetAppVersion sets the version of the app to use

type Version Uses

type Version int

Version defines the helm version

const (
    V2  Version = 2
    V3          = 3
)

Directories

PathSynopsis
mocks

Package helm imports 35 packages (graph) and is imported by 29 packages. Updated 2019-09-18. Refresh now. Tools for package owners.