helm

package
v1.8.9 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourcePolicyAnnotation = "helm.sh/resource-policy"
	ResourcePolicyKeep       = "keep"
)

Variables

View Source
var (
	ErrOCINotEnabled = errors.New("could not perform the action when oci is not enabled")
)

Functions

func IsHelmOciRepo added in v1.8.8

func IsHelmOciRepo(repoURL string) bool

Ensures that given OCI registries URL does not have protocol

func IsMissingDependencyErr added in v0.11.0

func IsMissingDependencyErr(err error) bool

IsMissingDependencyErr tests if the error is related to a missing chart dependency

func Version added in v1.3.0

func Version() (string, error)

Types

type AzureWorkloadIdentityCreds added in v1.8.8

type AzureWorkloadIdentityCreds struct {
	CAPath             string
	CertData           []byte
	KeyData            []byte
	InsecureSkipVerify bool
	// contains filtered or unexported fields
}

func NewAzureWorkloadIdentityCreds added in v1.8.8

func NewAzureWorkloadIdentityCreds(repoURL string, caPath string, certData []byte, keyData []byte, insecureSkipVerify bool, tokenProvider workloadidentity.TokenProvider) AzureWorkloadIdentityCreds

func (AzureWorkloadIdentityCreds) GetAccessToken added in v1.8.8

func (creds AzureWorkloadIdentityCreds) GetAccessToken() (string, error)

func (AzureWorkloadIdentityCreds) GetCAPath added in v1.8.8

func (creds AzureWorkloadIdentityCreds) GetCAPath() string

func (AzureWorkloadIdentityCreds) GetCertData added in v1.8.8

func (creds AzureWorkloadIdentityCreds) GetCertData() []byte

func (AzureWorkloadIdentityCreds) GetInsecureSkipVerify added in v1.8.8

func (creds AzureWorkloadIdentityCreds) GetInsecureSkipVerify() bool

func (AzureWorkloadIdentityCreds) GetKeyData added in v1.8.8

func (creds AzureWorkloadIdentityCreds) GetKeyData() []byte

func (AzureWorkloadIdentityCreds) GetPassword added in v1.8.8

func (creds AzureWorkloadIdentityCreds) GetPassword() (string, error)

func (AzureWorkloadIdentityCreds) GetUsername added in v1.8.8

func (creds AzureWorkloadIdentityCreds) GetUsername() string

type Client added in v1.3.0

type Client interface {
	CleanChartCache(chart string, version string) error
	ExtractChart(ctx context.Context, chart string, version string, passCredentials bool, manifestMaxExtractedSize int64, disableManifestMaxExtractedSize bool) (string, utilio.Closer, error)
	GetIndex(ctx context.Context, noCache bool, maxIndexSize int64) (*Index, error)
	GetTags(ctx context.Context, chart string, noCache bool) ([]string, error)
	TestHelmOCI() (bool, error)
}

func NewClient added in v1.3.0

func NewClient(repoURL string, creds Creds, enableOci bool, proxy string, noProxy string, opts ...ClientOpts) Client

func NewClientWithLock added in v1.3.0

func NewClientWithLock(repoURL string, creds Creds, repoLock sync.KeyLock, enableOci bool, proxy string, noProxy string, opts ...ClientOpts) Client

type ClientOpts added in v1.8.8

type ClientOpts func(c *nativeHelmChart)

func WithChartPaths added in v1.8.8

func WithChartPaths(chartPaths utilio.TempPaths) ClientOpts

func WithHelmChartCacheExpiration added in v1.8.8

func WithHelmChartCacheExpiration(helmChartCacheExpiration time.Duration) ClientOpts

WithHelmChartCacheExpiration sets the cache expiration duration for chart cache.

func WithIndexCache added in v1.8.8

func WithIndexCache(indexCache indexCache) ClientOpts

func WithPlainHTTP added in v1.8.8

func WithPlainHTTP() ClientOpts

WithPlainHTTP configures the client to use plain HTTP instead of HTTPS for OCI registry operations.

func WithUserAgent added in v1.8.8

func WithUserAgent(userAgent string) ClientOpts

WithUserAgent sets a custom User-Agent string for HTTP requests. If not set, a default User-Agent will be generated automatically.

type Cmd added in v1.3.0

type Cmd struct {
	WorkDir   string
	IsLocal   bool
	IsHelmOci bool
	// contains filtered or unexported fields
}

A thin wrapper around the "helm" command, adding logging and error translation.

func NewCmd added in v1.3.0

func NewCmd(workDir string, version string, proxy string, noProxy string) (*Cmd, error)

func NewCmdWithVersion added in v1.5.0

func NewCmdWithVersion(workDir string, isHelmOci bool, proxy string, noProxy string) (*Cmd, error)

func (*Cmd) Close added in v1.3.0

func (c *Cmd) Close()

func (*Cmd) Fetch added in v1.3.0

func (c *Cmd) Fetch(repo, chartName, version, destination string, creds Creds, passCredentials bool) (string, error)

func (*Cmd) Freestyle added in v1.8.8

func (c *Cmd) Freestyle(args ...string) (string, error)

func (*Cmd) InspectChart added in v1.8.8

func (c *Cmd) InspectChart() (string, error)

func (*Cmd) PullOCI added in v1.8.8

func (c *Cmd) PullOCI(repo string, chart string, version string, destination string, creds Creds, plainHTTP bool) (string, error)

func (*Cmd) RegistryLogin added in v1.8.8

func (c *Cmd) RegistryLogin(repo string, creds Creds, plainHTTP bool) (string, error)

func (*Cmd) RegistryLogout added in v1.8.8

func (c *Cmd) RegistryLogout(repo string, _ Creds) (string, error)

func (*Cmd) RepoAdd added in v1.3.0

func (c *Cmd) RepoAdd(name string, url string, opts Creds, passCredentials bool) (string, error)

type Creds added in v1.3.0

type Creds interface {
	GetUsername() string
	GetPassword() (string, error)
	GetCAPath() string
	GetCertData() []byte
	GetKeyData() []byte
	GetInsecureSkipVerify() bool
}

type Entries added in v1.4.0

type Entries []Entry

func (Entries) Tags added in v1.8.8

func (es Entries) Tags() []string

type Entry added in v1.3.0

type Entry struct {
	Version string
	Created time.Time
}

type Helm

type Helm interface {
	// Template returns a list of unstructured objects from a `helm template` command
	Template(opts *TemplateOpts) (string, string, error)
	// GetParameters returns a list of chart parameters taking into account values in provided YAML files.
	GetParameters(valuesFiles []pathutil.ResolvedFilePath, appPath, repoRoot string) (map[string]string, error)
	// DependencyBuild runs `helm dependency build` to download a chart's dependencies
	DependencyBuild() error
	// Dispose deletes temp resources
	Dispose()
}

Helm provides wrapper functionality around the `helm` command.

func NewHelmApp

func NewHelmApp(workDir string, repos []HelmRepository, isLocal bool, version string, proxy string, noProxy string, passCredentials bool, insecure bool) (Helm, error)

NewHelmApp create a new wrapper to run commands on the `helm` command-line tool.

type HelmCreds added in v1.8.8

type HelmCreds struct {
	Username           string
	Password           string
	CAPath             string
	CertData           []byte
	KeyData            []byte
	InsecureSkipVerify bool
}

func (HelmCreds) GetCAPath added in v1.8.8

func (creds HelmCreds) GetCAPath() string

func (HelmCreds) GetCertData added in v1.8.8

func (creds HelmCreds) GetCertData() []byte

func (HelmCreds) GetInsecureSkipVerify added in v1.8.8

func (creds HelmCreds) GetInsecureSkipVerify() bool

func (HelmCreds) GetKeyData added in v1.8.8

func (creds HelmCreds) GetKeyData() []byte

func (HelmCreds) GetPassword added in v1.8.8

func (creds HelmCreds) GetPassword() (string, error)

func (HelmCreds) GetUsername added in v1.8.8

func (creds HelmCreds) GetUsername() string

type HelmRepository added in v1.3.0

type HelmRepository struct {
	Creds
	Name                 string
	Repo                 string
	EnableOci            bool
	InsecureOCIForceHttp bool
}

type Index added in v1.3.0

type Index struct {
	Entries map[string]Entries
}

func (*Index) GetEntries added in v1.4.0

func (i *Index) GetEntries(chart string) (Entries, error)

type TemplateOpts added in v1.3.0

type TemplateOpts struct {
	Name        string
	Namespace   string
	KubeVersion string
	APIVersions []string
	Set         map[string]string
	SetString   map[string]string
	SetFile     map[string]pathutil.ResolvedFilePath
	Values      []pathutil.ResolvedFilePath
	// ExtraValues is the randomly-generated path to the temporary values file holding the contents of
	// spec.source.helm.values/valuesObject.
	ExtraValues          pathutil.ResolvedFilePath
	SkipCrds             bool
	SkipSchemaValidation bool
	SkipTests            bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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