helm

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: Apache-2.0 Imports: 22 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, data []byte) (bool, error)

OverwriteChartDefaultValues overwrites the chart default values file with the given data.

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 {
	// WorkingDir is the chroot path for dependency manager operations,
	// Dependencies that hold a local (relative) path reference are not
	// allowed to traverse outside this directory.
	WorkingDir string
	// ChartPath is the path of the Chart relative to the WorkingDir,
	// the combination of the WorkingDir and ChartPath is used to
	// determine the absolute path of a local dependency.
	ChartPath string
	// Chart holds the loaded chart.Chart from the ChartPath.
	Chart *helmchart.Chart
	// Dependencies contains a list of dependencies, and the respective
	// repository the dependency can be found at.
	Dependencies []*DependencyWithRepository
}

DependencyManager manages dependencies for a Helm chart.

func (*DependencyManager) Build added in v0.3.0

func (dm *DependencyManager) Build(ctx context.Context) error

Build compiles and builds the dependencies of the Chart.

type DependencyWithRepository added in v0.3.0

type DependencyWithRepository struct {
	// Dependency holds the reference to a chart.Chart dependency.
	Dependency *helmchart.Dependency
	// Repository is the ChartRepository the dependency should be
	// available at and can be downloaded from. If there is none,
	// a local ('file://') dependency is assumed.
	Repository *ChartRepository
}

DependencyWithRepository is a container for a Helm chart dependency and its respective repository.

Jump to

Keyboard shortcuts

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