helm

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChartClient added in v1.0.0

type ChartClient struct {
	ChartHelmClientProvider ChartHelmClientProvider
	// contains filtered or unexported fields
}

ChartClient allows users of this client to install and uninstall charts.

func NewChartClient added in v1.0.0

func NewChartClient(
	log log.Verboser,
	chartLoader ChartLoader,
	nameGenerator nameutil.Generator,
	ChartHelmClientProvider ChartHelmClientProvider,
) *ChartClient

NewChartClient creates a new ChartClient with the explicit dependencies.

func NewDefaultChartClient added in v1.0.0

func NewDefaultChartClient() *ChartClient

NewDefaultChartClient creates a new ChartClient with the default dependencies.

func (*ChartClient) Install added in v1.0.0

func (cc *ChartClient) Install(
	chartDef *repo.ChartVersion,
	namespace string,
	values map[string]interface{},
) (*release.Release, error)

Install installs a chart version into a specific namespace using the provided values.

func (*ChartClient) Uninstall added in v1.0.0

func (cc *ChartClient) Uninstall(releaseName, namespace string) error

Uninstall uninstalls a release from a namespace.

type ChartHelm added in v1.0.0

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

ChartHelm satisfies the ChartHelmClientProvider interface.

func NewChartHelm added in v1.0.0

func NewChartHelm(
	configProvider ConfigProvider,
	actionNewInstall func(*action.Configuration) *action.Install,
	actionNewUninstall func(*action.Configuration) *action.Uninstall,
) *ChartHelm

NewChartHelm creates a new ChartHelm with the explicit dependencies.

func NewDefaultChartHelm added in v1.0.0

func NewDefaultChartHelm() *ChartHelm

NewDefaultChartHelm creates a new ChartHelm with the default dependencies.

func (*ChartHelm) ProvideInstaller added in v1.0.0

func (ch *ChartHelm) ProvideInstaller(
	releaseName string,
	namespace string,
) (ChartInstallRunner, error)

ProvideInstaller provides a Helm action client for installing charts.

func (*ChartHelm) ProvideUninstaller added in v1.0.0

func (ch *ChartHelm) ProvideUninstaller(namespace string) (ChartUninstallRunner, error)

ProvideUninstaller provides a Helm action client for uninstalling charts.

type ChartHelmClientProvider added in v1.0.0

type ChartHelmClientProvider interface {
	ProvideInstaller(releaseName, namespace string) (ChartInstallRunner, error)
	ProvideUninstaller(namespace string) (ChartUninstallRunner, error)
}

ChartHelmClientProvider is the interface that wraps the methods for providing Helm action clients for installing and uninstalling charts.

type ChartInstallRunner added in v1.0.0

type ChartInstallRunner func(*chart.Chart, map[string]interface{}) (*release.Release, error)

ChartInstallRunner defines the signature for a function that installs a chart.

type ChartLoader added in v1.0.0

type ChartLoader interface {
	Load(chartURL string) (*chart.Chart, error)
}

ChartLoader is the interface that wraps the Load method.

type ChartManager added in v1.0.0

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

ChartManager satisfies the ChartLoader interface.

func NewChartManager added in v1.0.0

func NewChartManager(
	httpGetter HTTPGetter,
	loadChartArchive func(io.Reader) (*chart.Chart, error),
) *ChartManager

NewChartManager creates a new ChartManager with the explicit dependencies.

func NewDefaultChartManager added in v1.0.0

func NewDefaultChartManager() *ChartManager

NewDefaultChartManager creates a new ChartManager with the default dependencies.

func (*ChartManager) Load added in v1.0.0

func (cm *ChartManager) Load(chartURL string) (*chart.Chart, error)

Load loads a chart from a URL. TODO(f0rmiga): implement caching for chart archives.

type ChartRepo added in v1.0.0

type ChartRepo interface {
	DownloadIndexFile() (string, error)
}

ChartRepo is the interface that wraps the DownloadIndexFile method. It exists to be mocked on the Downloader.Download.

type ChartUninstallRunner added in v1.0.0

type ChartUninstallRunner func(string) (*release.UninstallReleaseResponse, error)

ChartUninstallRunner defines the signature for a function that uninstalls a chart.

type Client

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

Client represents a Helm client to interact with the k8s cluster.

func NewClient

func NewClient(
	log log.Verboser,
	repositoryClient RepositoryInitializeDownloadLoader,
	chartClient *ChartClient,
) *Client

NewClient creates a new client with explicit dependencies.

func NewDefaultClient added in v1.0.0

func NewDefaultClient() *Client

NewDefaultClient creates a new Client with the default dependencies.

func (*Client) ChartClient added in v1.0.0

func (c *Client) ChartClient() *ChartClient

ChartClient returns the chart client for installing and uninstalling a chart.

func (*Client) GetChart

func (c *Client) GetChart(name, appVersion string) (*repo.ChartVersion, error)

GetChart gets a chart that exists in the chart repository. IndexFile.Get() cannot be used here since we filter by app version.

func (*Client) Initialize added in v1.0.0

func (c *Client) Initialize(repoURL string) error

Initialize initializes a chart repository. TODO(f0rmiga): be able to handle multiple repositories. How can we handle charts with the same name across repositories? TODO(f0rmiga): add a readiness probe for this initialization process. A health endpoint would be enough.

func (*Client) ListCharts

func (c *Client) ListCharts() map[string]repo.ChartVersions

ListCharts lists the charts from the chart repository.

type ConfigInitializer added in v1.0.0

type ConfigInitializer func(
	getter genericclioptions.RESTClientGetter,
	namespace string,
	helmDriver string,
	log action.DebugLog,
) error

ConfigInitializer is the function signature of the action.Configuration.Init method to avoid a hidden dependency call in the Config.Provide method.

func DefaultConfigInitializerProvider added in v1.0.0

func DefaultConfigInitializerProvider() (*action.Configuration, ConfigInitializer)

DefaultConfigInitializerProvider is the default implementation for ConfigInitializerProvider.

type ConfigInitializerProvider added in v1.0.0

type ConfigInitializerProvider func() (*action.Configuration, ConfigInitializer)

ConfigInitializerProvider defines the signature for a function that provides an *action.Configuration and its Init method.

type ConfigProvider added in v1.0.0

type ConfigProvider func(namespace string) (*action.Configuration, error)

ConfigProvider defines the signature for a function that provides *action.Configuration.

func NewConfigProvider added in v1.0.0

func NewConfigProvider(
	log log.Verboser,
	configInitializerProvider ConfigInitializerProvider,
	kubeConfig string,
	context string,
) ConfigProvider

NewConfigProvider creates a new ConfigProvider using the explicit dependencies.

func NewDefaultConfigProvider added in v1.0.0

func NewDefaultConfigProvider() ConfigProvider

NewDefaultConfigProvider creates a new ConfigProvider using the default dependencies.

type HTTPGetter added in v1.0.0

type HTTPGetter interface {
	Get(string) (*http.Response, error)
}

HTTPGetter is the interface that wraps the Get method to be used with the default library http.DefaultClient.

type RepositoryClient added in v1.0.0

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

RepositoryClient satisfies the RepositoryInitializeDownloadLoader interface.

func NewDefaultRepositoryClient added in v1.0.0

func NewDefaultRepositoryClient() *RepositoryClient

NewDefaultRepositoryClient creates a new RepositoryClient with the default dependencies.

func NewRepositoryClient added in v1.0.0

func NewRepositoryClient(
	newChartRepository func(*repo.Entry, getter.Providers) (*repo.ChartRepository, error),
	loadIndexFile func(string) (*repo.IndexFile, error),
) *RepositoryClient

NewRepositoryClient creates a new RepositoryClient with the explicit dependencies.

func (*RepositoryClient) DownloadIndex added in v1.0.0

func (*RepositoryClient) DownloadIndex(chartRepo ChartRepo) (string, error)

DownloadIndex downloads a chart repository index and returns its path.

func (*RepositoryClient) Initialize added in v1.0.0

func (rc *RepositoryClient) Initialize(
	cfg *repo.Entry,
	providers getter.Providers,
) (*repo.ChartRepository, error)

Initialize initializes a repo.ChartRepository.

func (*RepositoryClient) Load added in v1.0.0

func (rc *RepositoryClient) Load(path string) (*repo.IndexFile, error)

Load loads a chart repository index file using the path on disk.

type RepositoryDownloader added in v1.0.0

type RepositoryDownloader interface {
	DownloadIndex(ChartRepo) (string, error)
}

RepositoryDownloader is the interface that wraps the DownloadIndex method for downloading a ChartRepo.

type RepositoryInitializeDownloadLoader added in v1.0.0

type RepositoryInitializeDownloadLoader interface {
	RepositoryInitializer
	RepositoryDownloader
	RepositoryLoader
}

RepositoryInitializeDownloadLoader wraps all the repository interfaces.

type RepositoryInitializer added in v1.0.0

type RepositoryInitializer interface {
	Initialize(*repo.Entry, getter.Providers) (*repo.ChartRepository, error)
}

RepositoryInitializer is the interface that wraps the Initialize method for initializing a repo.ChartRepository.

type RepositoryLoader added in v1.0.0

type RepositoryLoader interface {
	Load(path string) (*repo.IndexFile, error)
}

RepositoryLoader is the interface that wraps the chart repository Load method.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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