Documentation ¶
Index ¶
- Constants
- func AppendMyValues(valueFiles []string) ([]string, error)
- func FindRequirementsFileName(dir string) (string, error)
- func LoadChartName(chartFile string) (string, error)
- func LoadChartNameAndVersion(chartFile string) (string, string, error)
- func ModifyChart(chartFile string, fn func(chart *chart.Metadata) error) error
- func SaveRequirementsFile(fileName string, requirements *Requirements) error
- func SetChartVersion(chartFile string, version string) error
- type ChartSummary
- type DepSorter
- type Dependency
- type ErrNoRequirementsFile
- type HelmCLI
- func (h *HelmCLI) AddRepo(repo string, URL string) error
- func (h *HelmCLI) BuildDependency() error
- func (h *HelmCLI) DeleteRelease(ns string, releaseName string, purge bool) error
- func (h *HelmCLI) Env() map[string]string
- func (h *HelmCLI) FindChart() (string, error)
- func (h *HelmCLI) HelmBinary() string
- func (h *HelmCLI) Init(clientOnly bool, serviceAccount string, tillerNamespace string, upgrade bool) error
- func (h *HelmCLI) InstallChart(chart string, releaseName string, ns string, version *string, timeout *int, ...) error
- func (h *HelmCLI) IsRepoMissing(URL string) (bool, error)
- func (h *HelmCLI) Lint() (string, error)
- func (h *HelmCLI) ListCharts() (string, error)
- func (h *HelmCLI) ListRepos() (map[string]string, error)
- func (h *HelmCLI) PackageChart() error
- func (h *HelmCLI) RemoveRepo(repo string) error
- func (h *HelmCLI) RemoveRequirementsLock() error
- func (h *HelmCLI) SearchChartVersions(chart string) ([]string, error)
- func (h *HelmCLI) SearchCharts(filter string) ([]ChartSummary, error)
- func (h *HelmCLI) SetCWD(dir string)
- func (h *HelmCLI) SetHelmBinary(binary string)
- func (h *HelmCLI) SetHost(tillerAddress string)
- func (h *HelmCLI) StatusRelease(ns string, releaseName string) error
- func (h *HelmCLI) StatusReleases(ns string) (map[string]string, error)
- func (h *HelmCLI) Template(chart string, releaseName string, ns string, outDir string, upgrade bool, ...) error
- func (h *HelmCLI) UpdateRepo() error
- func (h *HelmCLI) UpgradeChart(chart string, releaseName string, ns string, version *string, install bool, ...) error
- func (h *HelmCLI) Version(tls bool) (string, error)
- func (h *HelmCLI) VersionWithArgs(tls bool, extraArgs ...string) (string, error)
- type HelmHook
- type HelmTemplate
- func (h *HelmTemplate) AddRepo(repo string, URL string) error
- func (h *HelmTemplate) BuildDependency() error
- func (h *HelmTemplate) DeleteRelease(ns string, releaseName string, purge bool) error
- func (h *HelmTemplate) Env() map[string]string
- func (h *HelmTemplate) FindChart() (string, error)
- func (h *HelmTemplate) HelmBinary() string
- func (h *HelmTemplate) Init(clientOnly bool, serviceAccount string, tillerNamespace string, upgrade bool) error
- func (h *HelmTemplate) InstallChart(chart string, releaseName string, ns string, version *string, timeout *int, ...) error
- func (h *HelmTemplate) IsRepoMissing(URL string) (bool, error)
- func (h *HelmTemplate) Lint() (string, error)
- func (h *HelmTemplate) ListCharts() (string, error)
- func (h *HelmTemplate) ListRepos() (map[string]string, error)
- func (h *HelmTemplate) PackageChart() error
- func (h *HelmTemplate) RemoveRepo(repo string) error
- func (h *HelmTemplate) RemoveRequirementsLock() error
- func (h *HelmTemplate) SearchChartVersions(chart string) ([]string, error)
- func (h *HelmTemplate) SearchCharts(filter string) ([]ChartSummary, error)
- func (h *HelmTemplate) SetCWD(dir string)
- func (h *HelmTemplate) SetHelmBinary(binary string)
- func (h *HelmTemplate) SetHost(tillerAddress string)
- func (h *HelmTemplate) StatusRelease(ns string, releaseName string) error
- func (h *HelmTemplate) StatusReleases(ns string) (map[string]string, error)
- func (h *HelmTemplate) UpdateRepo() error
- func (h *HelmTemplate) UpgradeChart(chart string, releaseName string, ns string, version *string, install bool, ...) error
- func (h *HelmTemplate) Version(tls bool) (string, error)
- type Helmer
- type Requirements
- type Version
Constants ¶
const ( RequirementsFileName = "requirements.yaml" DefaultHelmRepositoryURL = "http://jenkins-x-chartmuseum:8080" )
const ( // LabelReleaseName stores the chart release name LabelReleaseName = "jenkins.io/chart-release" // LabelReleaseChartVersion stores the version of a chart installation in a label LabelReleaseChartVersion = "jenkins.io/version" )
Variables ¶
This section is empty.
Functions ¶
func AppendMyValues ¶ added in v1.3.188
func FindRequirementsFileName ¶
FindRequirementsFileName returns the default requirements.yaml file name
func LoadChartName ¶ added in v1.0.48
func LoadChartNameAndVersion ¶ added in v1.2.132
func ModifyChart ¶ added in v1.3.313
ModifyChart modifies the given chart using a callback
func SaveRequirementsFile ¶
func SaveRequirementsFile(fileName string, requirements *Requirements) error
SaveRequirementsFile saves the requirements file
func SetChartVersion ¶ added in v1.3.313
SetChartVersion modifies the given chart file to update the version
Types ¶
type ChartSummary ¶ added in v1.3.166
type DepSorter ¶ added in v1.3.87
type DepSorter []*Dependency
DepSorter Used to avoid merge conflicts by sorting deps by name
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 ¶ added in v1.3.68
HelmCLI implements common helm actions based on helm CLI
func NewHelmCLI ¶ added in v1.3.68
NewHelmCLI creates a new HelmCLI instance configured to use the provided helm CLI in the given current working directory
func (*HelmCLI) BuildDependency ¶ added in v1.3.68
BuildDependency builds the helm dependencies of the helm chart from the current working directory
func (*HelmCLI) DeleteRelease ¶ added in v1.3.68
DeleteRelease removes the given release
func (*HelmCLI) FindChart ¶ added in v1.3.68
FindChart find a chart in the current working directory, if no chart file is found an error is returned
func (*HelmCLI) HelmBinary ¶ added in v1.3.68
HelmBinary return the configured helm CLI
func (*HelmCLI) Init ¶ added in v1.3.68
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 ¶ added in v1.3.68
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 ¶ added in v1.3.68
IsRepoMissing checks if the repository with the given URL is missing from helm
func (*HelmCLI) Lint ¶ added in v1.3.68
Lint lints the helm chart from the current working directory and returns the warnings in the output
func (*HelmCLI) ListCharts ¶ added in v1.3.68
ListCharts execute the helm list command and returns its output
func (*HelmCLI) ListRepos ¶ added in v1.3.68
ListRepos list the installed helm repos together with their URL
func (*HelmCLI) PackageChart ¶ added in v1.3.68
PackageChart packages the chart from the current working directory
func (*HelmCLI) RemoveRepo ¶ added in v1.3.68
RemoveRepo removes the given repo from helm
func (*HelmCLI) RemoveRequirementsLock ¶ added in v1.3.68
RemoveRequirementsLock removes the requirements.lock file from the current working directory
func (*HelmCLI) SearchChartVersions ¶ added in v1.3.68
SearchChartVersions search all version of the given chart
func (*HelmCLI) SearchCharts ¶ added in v1.3.166
func (h *HelmCLI) SearchCharts(filter string) ([]ChartSummary, error)
SearchCharts searches for all the charts matching the given filter
func (*HelmCLI) SetCWD ¶ added in v1.3.68
SetCWD configures the common working directory of helm CLI
func (*HelmCLI) SetHelmBinary ¶ added in v1.3.68
SetHelmBinary configure a new helm CLI
func (*HelmCLI) StatusRelease ¶ added in v1.3.68
StatusRelease returns the output of the helm status command for a given release
func (*HelmCLI) StatusReleases ¶ added in v1.3.68
StatusReleases returns the status of all installed releases
func (*HelmCLI) Template ¶ added in v1.3.313
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 ¶ added in v1.3.68
UpdateRepo updates the helm repositories
func (*HelmCLI) UpgradeChart ¶ added in v1.3.68
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
type HelmHook ¶ added in v1.3.336
type HelmHook struct { Kind string Name string File string Hooks []string HookDeletePolicies []string }
func MatchingHooks ¶ added in v1.3.336
MatchingHooks returns the matching files which have the given hook name and if hookPolicy is not blank the hook policy too
type HelmTemplate ¶ added in v1.3.313
type HelmTemplate struct { Client *HelmCLI WorkDir string CWD string Binary string Runner *util.Command KubectlValidate bool KubeClient kubernetes.Interface }
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 ¶ added in v1.3.313
func NewHelmTemplate(client *HelmCLI, workDir string, kubeClient kubernetes.Interface) *HelmTemplate
NewHelmTemplate creates a new HelmTemplate instance configured to the given client side Helmer
func (*HelmTemplate) AddRepo ¶ added in v1.3.313
func (h *HelmTemplate) AddRepo(repo string, URL string) error
AddRepo adds a new helm repo with the given name and URL
func (*HelmTemplate) BuildDependency ¶ added in v1.3.313
func (h *HelmTemplate) BuildDependency() error
BuildDependency builds the helm dependencies of the helm chart from the current working directory
func (*HelmTemplate) DeleteRelease ¶ added in v1.3.313
func (h *HelmTemplate) DeleteRelease(ns string, releaseName string, purge bool) error
DeleteRelease removes the given release
func (*HelmTemplate) Env ¶ added in v1.3.313
func (h *HelmTemplate) Env() map[string]string
Env returns the environment variables for the helmer
func (*HelmTemplate) FindChart ¶ added in v1.3.313
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 ¶ added in v1.3.313
func (h *HelmTemplate) HelmBinary() string
HelmBinary return the configured helm CLI
func (*HelmTemplate) Init ¶ added in v1.3.313
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 ¶ added in v1.3.313
func (h *HelmTemplate) 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 (*HelmTemplate) IsRepoMissing ¶ added in v1.3.313
func (h *HelmTemplate) IsRepoMissing(URL string) (bool, error)
IsRepoMissing checks if the repository with the given URL is missing from helm
func (*HelmTemplate) Lint ¶ added in v1.3.313
func (h *HelmTemplate) Lint() (string, error)
Lint lints the helm chart from the current working directory and returns the warnings in the output
func (*HelmTemplate) ListCharts ¶ added in v1.3.313
func (h *HelmTemplate) ListCharts() (string, error)
ListCharts execute the helm list command and returns its output
func (*HelmTemplate) ListRepos ¶ added in v1.3.313
func (h *HelmTemplate) ListRepos() (map[string]string, error)
ListRepos list the installed helm repos together with their URL
func (*HelmTemplate) PackageChart ¶ added in v1.3.313
func (h *HelmTemplate) PackageChart() error
PackageChart packages the chart from the current working directory
func (*HelmTemplate) RemoveRepo ¶ added in v1.3.313
func (h *HelmTemplate) RemoveRepo(repo string) error
RemoveRepo removes the given repo from helm
func (*HelmTemplate) RemoveRequirementsLock ¶ added in v1.3.313
func (h *HelmTemplate) RemoveRequirementsLock() error
RemoveRequirementsLock removes the requirements.lock file from the current working directory
func (*HelmTemplate) SearchChartVersions ¶ added in v1.3.313
func (h *HelmTemplate) SearchChartVersions(chart string) ([]string, error)
SearchChartVersions search all version of the given chart
func (*HelmTemplate) SearchCharts ¶ added in v1.3.313
func (h *HelmTemplate) SearchCharts(filter string) ([]ChartSummary, error)
SearchCharts searches for all the charts matching the given filter
func (*HelmTemplate) SetCWD ¶ added in v1.3.313
func (h *HelmTemplate) SetCWD(dir string)
SetCWD configures the common working directory of helm CLI
func (*HelmTemplate) SetHelmBinary ¶ added in v1.3.313
func (h *HelmTemplate) SetHelmBinary(binary string)
SetHelmBinary configure a new helm CLI
func (*HelmTemplate) SetHost ¶ added in v1.3.313
func (h *HelmTemplate) SetHost(tillerAddress string)
SetHost is used to point at a locally running tiller
func (*HelmTemplate) StatusRelease ¶ added in v1.3.313
func (h *HelmTemplate) StatusRelease(ns string, releaseName string) error
StatusRelease returns the output of the helm status command for a given release
func (*HelmTemplate) StatusReleases ¶ added in v1.3.313
func (h *HelmTemplate) StatusReleases(ns string) (map[string]string, error)
StatusReleases returns the status of all installed releases
func (*HelmTemplate) UpdateRepo ¶ added in v1.3.313
func (h *HelmTemplate) UpdateRepo() error
UpdateRepo updates the helm repositories
func (*HelmTemplate) UpgradeChart ¶ added in v1.3.313
func (h *HelmTemplate) 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
type Helmer ¶ added in v1.3.68
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(ns string, releaseName string, purge bool) error ListCharts() (string, error) SearchChartVersions(chart string) ([]string, error) FindChart() (string, error) PackageChart() error StatusRelease(ns string, releaseName string) error StatusReleases(ns string) (map[string]string, error) Lint() (string, error) Version(tls bool) (string, error) SearchCharts(filter string) ([]ChartSummary, error) SetHost(host string) Env() map[string]string }
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 ¶ added in v1.2.39
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, alias string)
SetAppVersion sets the version of the app to use