helm

package
v1.0.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverChartVersions added in v0.7.0

func DiscoverChartVersions(
	ctx context.Context,
	repoURL string,
	chart string,
	semverConstraint string,
	creds *Credentials,
) ([]string, error)

DiscoverChartVersions connects to the specified Helm chart repository and retrieves all available versions of the specified chart, optionally filtering by a SemVer constraint. It then returns the versions in descending order.

The repository can be either a classic chart repository (using HTTP/S) or a repository within an OCI registry. Classic chart repositories can contain differently named charts. When repoURL points to such a repository, the name argument must specify the name of the chart within the repository. In the case of a repository within an OCI registry, the URL implicitly points to a specific chart and the name argument must be empty.

The credentials argument may be nil for public repositories, but must be non-nil for private repositories.

It returns an error if the repository cannot be reached or if the versions cannot be retrieved, but it does not return an error if no versions of the chart are found in the repository.

func Login added in v0.7.0

func Login(homePath, repository string, credentials Credentials) error

Login runs `helm registry login` or `helm repo add` for the provided repository. The provided homePath is used to set the HOME environment variable, as well as the XDG_* environment variables. This ensures that Helm uses the provided homePath as its configuration directory, and allows for isolation.

func NewRegistryClient added in v0.9.0

func NewRegistryClient(home string) (*registry.Client, error)

func NormalizeChartRepositoryURL added in v0.5.0

func NormalizeChartRepositoryURL(repo string) string

NormalizeChartRepositoryURL normalizes a chart repository URL for purposes of comparison. Crucially, this function removes the oci:// prefix from the URL if there is one.

func UpdateChartDependencies

func UpdateChartDependencies(homePath, chartPath string) error

UpdateChartDependencies runs `helm dependency update` for the chart at the provided chartPath. The homePath is used to set the HOME environment variable, as well as the XDG_* environment variables. This ensures that Helm uses the provided homePath as its configuration directory, and allows for isolation.

Types

type Credentials

type Credentials struct {
	// Username identifies a principal, which combined with the value of the
	// Password field, can be used for reading from some remote repository.
	Username string
	// Password, when combined with the principal identified by the Username
	// field, can be used for both reading from some remote repository.
	Password string
}

Credentials represents the credentials for connecting to a private Helm chart repository.

Jump to

Keyboard shortcuts

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