helm

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuthFromSecret

func BasicAuthFromSecret(secret corev1.Secret) (getter.Option, error)

BasicAuthFromSecret attempts to construct a basic auth getter.Option for the given v1.Secret and returns the result.

Secrets with no username AND password are ignored, if only one is defined it returns an error.

func ClientOptionsFromSecret

func ClientOptionsFromSecret(secret corev1.Secret) ([]getter.Option, func(), error)

ClientOptionsFromSecret constructs a getter.Option slice for the given secret. It returns the slice, and a callback to remove temporary files.

func NormalizeChartRepositoryURL added in v0.2.0

func NormalizeChartRepositoryURL(url string) string

NormalizeChartRepositoryURL ensures repository urls are normalized

func OverwriteChartDefaultValues added in v0.0.15

func OverwriteChartDefaultValues(chart *helmchart.Chart, valuesFile string) (bool, error)

OverwriteChartDefaultValues overwrites the chart default values file with the contents of the given valuesFile.

func TLSClientConfigFromSecret

func TLSClientConfigFromSecret(secret corev1.Secret) (getter.Option, func(), error)

TLSClientConfigFromSecret attempts to construct a TLS client config getter.Option for the given v1.Secret. It returns the getter.Option and a callback to remove the temporary TLS files.

Secrets with no certFile, keyFile, AND caFile are ignored, if only a certBytes OR keyBytes is defined it returns an error.

Types

type ChartRepository added in v0.1.0

type ChartRepository struct {
	URL     string
	Index   *repo.IndexFile
	Client  getter.Getter
	Options []getter.Option
}

ChartRepository represents a Helm chart repository, and the configuration required to download the chart index, and charts from the repository.

func NewChartRepository added in v0.1.0

func NewChartRepository(repositoryURL string, providers getter.Providers, opts []getter.Option) (*ChartRepository, error)

NewChartRepository constructs and returns a new ChartRepository with the ChartRepository.Client configured to the getter.Getter for the repository URL scheme. It returns an error on URL parsing failures, or if there is no getter available for the scheme.

func (*ChartRepository) DownloadChart added in v0.1.0

func (r *ChartRepository) DownloadChart(chart *repo.ChartVersion) (*bytes.Buffer, error)

DownloadChart confirms the given repo.ChartVersion has a downloadable URL, and then attempts to download the chart using the Client and Options of the ChartRepository. It returns a bytes.Buffer containing the chart data.

func (*ChartRepository) DownloadIndex added in v0.1.0

func (r *ChartRepository) DownloadIndex() error

DownloadIndex attempts to download the chart repository index using the Client and set Options, and loads the index file into the Index. It returns an error on URL parsing and Client failures.

func (*ChartRepository) Get added in v0.1.0

func (r *ChartRepository) Get(name, ver string) (*repo.ChartVersion, error)

Get returns the repo.ChartVersion for the given name, the version is expected to be a semver.Constraints compatible string. If version is empty, the latest stable version will be returned and prerelease versions will be ignored.

func (*ChartRepository) LoadIndex added in v0.1.0

func (r *ChartRepository) LoadIndex(b []byte) error

LoadIndex loads the given bytes into the Index while performing minimal validity checks. It fails if the API version is not set (repo.ErrNoAPIVersion), or if the unmarshal fails.

The logic is derived from and on par with: https://github.com/helm/helm/blob/v3.3.4/pkg/repo/index.go#L301

type DependencyManager added in v0.3.0

type DependencyManager struct {
	Chart        *helmchart.Chart
	ChartPath    string
	Dependencies []*DependencyWithRepository
}

DependencyManager manages dependencies for helm charts

func (*DependencyManager) Build added in v0.3.0

func (dm *DependencyManager) Build() error

Build compiles and builds the chart dependencies

type DependencyWithRepository added in v0.3.0

type DependencyWithRepository struct {
	Dependency *helmchart.Dependency
	Repo       *ChartRepository
}

DependencyWithRepository is a container for a dependency and its respective repository

Jump to

Keyboard shortcuts

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