helm

package
v2.3.10 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 28 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HelmV2 represents helm V2 specific settings
	HelmV2 = HelmVer{
			// contains filtered or unexported fields
	}
	// HelmV3 represents helm V3 specific settings
	HelmV3 = HelmVer{
			// contains filtered or unexported fields
	}
)

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(shortForm bool) (string, error)

Types

type Client

type Client interface {
	CleanChartCache(chart string, version string) error
	ExtractChart(chart string, version string, passCredentials bool) (string, io.Closer, error)
	GetIndex(noCache bool) (*Index, error)
	TestHelmOCI() (bool, error)
}

func NewClient

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

func NewClientWithLock

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

type ClientOpts added in v2.1.0

type ClientOpts func(c *nativeHelmChart)

func WithChartPaths added in v2.3.0

func WithChartPaths(chartPaths *io.TempPaths) ClientOpts

func WithIndexCache added in v2.1.0

func WithIndexCache(indexCache indexCache) ClientOpts

type Cmd

type Cmd struct {
	HelmVer

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

func NewCmdWithVersion

func NewCmdWithVersion(workDir string, version HelmVer, isHelmOci bool, proxy 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 added in v2.3.0

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

func (*Cmd) Init

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

func (*Cmd) PullOCI added in v2.2.0

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

func (*Cmd) RegistryLogin added in v2.2.0

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

func (*Cmd) RegistryLogout added in v2.2.0

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

func (*Cmd) RepoAdd

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

type Creds

type Creds struct {
	Username           string
	Password           string
	CAPath             string
	CertData           []byte
	KeyData            []byte
	InsecureSkipVerify 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, 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
	// Init runs `helm init --client-only`
	Init() 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, passCredentials bool) (Helm, error)

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

type HelmRepository

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

type HelmVer

type HelmVer struct {
	// contains filtered or unexported fields
}

HelmVer contains Helm version specific settings such as helm binary and command names

type Index

type Index struct {
	Entries map[string]Entries
}

func (*Index) GetEntries

func (i *Index) GetEntries(chart string) (Entries, 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
	SkipCrds    bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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