helm

package
v3.0.0-...-8a447d9 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 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 (
	OCINotEnabledErr = errors.New("could not perform the action when oci is not enabled")
)

Functions

func IsHelmOciRepo

func IsHelmOciRepo(repoURL string) bool

Ensures that given OCI registries URL does not have protocol

func IsMissingDependencyErr

func IsMissingDependencyErr(err error) bool

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

func IsVersion

func IsVersion(text string) bool

func Version

func Version() (string, error)

Types

type AzureWorkloadIdentityCreds

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

func NewAzureWorkloadIdentityCreds

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

func (AzureWorkloadIdentityCreds) GetAccessToken

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

func (AzureWorkloadIdentityCreds) GetCAPath

func (creds AzureWorkloadIdentityCreds) GetCAPath() string

func (AzureWorkloadIdentityCreds) GetCertData

func (creds AzureWorkloadIdentityCreds) GetCertData() []byte

func (AzureWorkloadIdentityCreds) GetInsecureSkipVerify

func (creds AzureWorkloadIdentityCreds) GetInsecureSkipVerify() bool

func (AzureWorkloadIdentityCreds) GetKeyData

func (creds AzureWorkloadIdentityCreds) GetKeyData() []byte

func (AzureWorkloadIdentityCreds) GetPassword

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

func (AzureWorkloadIdentityCreds) GetUsername

func (creds AzureWorkloadIdentityCreds) GetUsername() string

type Client

type Client interface {
	CleanChartCache(chart string, version string, project string) error
	ExtractChart(chart string, version string, project string, passCredentials bool, manifestMaxExtractedSize int64, disableManifestMaxExtractedSize bool) (string, argoio.Closer, error)
	GetIndex(noCache bool, maxIndexSize int64) (*Index, error)
	GetTags(chart string, noCache bool) (*TagsList, error)
	TestHelmOCI() (bool, error)
}

func NewClient

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

func NewClientWithLock

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

type ClientOpts

type ClientOpts func(c *nativeHelmChart)

func WithChartPaths

func WithChartPaths(chartPaths argoio.TempPaths) ClientOpts

func WithIndexCache

func WithIndexCache(indexCache indexCache) ClientOpts

type Cmd

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

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

func NewCmdWithVersion

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

func (*Cmd) Close

func (c *Cmd) Close()

func (*Cmd) Fetch

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

func (*Cmd) Freestyle

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

func (*Cmd) InspectChart

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

func (*Cmd) PullOCI

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

func (*Cmd) RegistryLogin

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

func (*Cmd) RegistryLogout

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

func (*Cmd) RepoAdd

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

type Creds

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

type Entries

type Entries []Entry

func (Entries) MaxVersion

func (e Entries) MaxVersion(constraints *semver.Constraints) (*semver.Version, error)

type Entry

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) (Helm, error)

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

type HelmCreds

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

func (HelmCreds) GetCAPath

func (creds HelmCreds) GetCAPath() string

func (HelmCreds) GetCertData

func (creds HelmCreds) GetCertData() []byte

func (HelmCreds) GetInsecureSkipVerify

func (creds HelmCreds) GetInsecureSkipVerify() bool

func (HelmCreds) GetKeyData

func (creds HelmCreds) GetKeyData() []byte

func (HelmCreds) GetPassword

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

func (HelmCreds) GetUsername

func (creds HelmCreds) GetUsername() string

type HelmRepository

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

type Index

type Index struct {
	Entries map[string]Entries
}

func (*Index) GetEntries

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

type TagsList

type TagsList struct {
	Tags []string
}

func (TagsList) MaxVersion

func (t TagsList) MaxVersion(constraints *semver.Constraints) (*semver.Version, error)

type TemplateOpts

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