helm

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func New

func New(kubeConfig string) *Manager

func (*Manager) RunInstall

func (m *Manager) RunInstall(opts ...Option) error

RunInstall provides a way to install the helm chart either from the local path or using the configured helm repository with a specific chart name.

func (*Manager) RunRepo

func (m *Manager) RunRepo(opts ...Option) error

RunRepo provides a way to run `helm repo` sub command hierarchies using the right combination of WithArgs to build the suitable repo management sub command structure.

func (*Manager) RunTemplate

func (m *Manager) RunTemplate(opts ...Option) error

RunTemplate provides a way to invoke the `helm template` commands that can be used to perform the basic sanity check on the charts to make sure if the charts can be rendered successfully or not.

func (*Manager) RunTest

func (m *Manager) RunTest(opts ...Option) error

RunTest provides a way to perform the `helm test` sub command that can be leveraged to perform a test using the helm infra on the deployed charts.

func (*Manager) RunUninstall added in v0.0.8

func (m *Manager) RunUninstall(opts ...Option) error

RunUninstall provides a way to uninstall the specified helm chart (useful in teardowns etc...)

func (*Manager) RunUpgrade

func (m *Manager) RunUpgrade(opts ...Option) error

RunUpgrade provides a way to invoke the `helm upgrade` sub commands that can be used to perform the chart upgrade operation tests. This can be combined with suitable arguments to even install the charts if they are not already existing in the cluster.

func (*Manager) WithPath added in v0.3.0

func (m *Manager) WithPath(path string) *Manager

WithPath is used to provide a custom path where the `helm` executable command can be found. This is useful in case if your binary is in a non standard location and you want to framework to use that instead of returning an error.

type Option

type Option func(*Opts)

func WithArgs

func WithArgs(args ...string) Option

WithArgs is used to inject additional arguments into the Helm commands. Please pay careful consideration while using this as the current one does not have the ability to de-dup the arguments since options such as -f or --set can be used multiple times with different values, and we wanted the end user to make the decision of how the commands are invoked and not restrict them to a specific way of invoking the commands.

func WithChart

func WithChart(chart string) Option

WithChart is used to configure the full path of the .tgz artifact of the Helm chart in case if your tests require you to be able to deploy a packaged helm chart that is available locally as the tarball

func WithName

func WithName(name string) Option

WithName is used to set the name of the helm chart being processed

func WithNamespace

func WithNamespace(namespace string) Option

WithNamespace is used to configure the namespace in which the helm chart identified by WithName will be processed

func WithReleaseName

func WithReleaseName(releaseName string) Option

WithReleaseName is used to configure the name of the release to be used while installing or upgrading the chart identified by WithName into the WithNamespace configured namespace

func WithTimeout

func WithTimeout(timeout string) Option

WithTimeout is used to configure the time for which the helm command should be in blocked wait mode for the acceptable state of the resource to be reached

func WithVersion

func WithVersion(version string) Option

WithVersion is used to configre helm chart version that should be deployed to the test infrastructure

func WithWait

func WithWait() Option

WithWait is used to configure the argument used by the helm to indicate it should wait for an acceptable state of the resource before yielding the control back to the invocation point

type Opts

type Opts struct {
	// Name is used to indicate the name of the helm chart being processed
	Name string
	// Namespace is used to indicate the namespace in which the helm chart
	// identified by Name will be processed
	Namespace string
	// ReleaseName is used to indicate the name of the release to be used
	// while installing or upgrading the chart identified by Name into the
	// Namespace
	ReleaseName string
	// Version is the helm chart version that should be deployed to the test
	// infrastructure
	Version string
	// Chart is used to indicate the full path of the .tgz artifact of the Helm
	// chart in case if your tests require you to be able to deploy a packaged
	// helm chart that is available locally as the tarball
	Chart string

	// Args is used to pass any additional arguments that you might want to pass
	// for running the helm command in question
	Args []string
	// Wait is used to indicate if the helm command should wait for the runtime
	// to reach an acceptable state before returning the control back. The duration
	// for which this call is blocked is defined by the value set to Timeout
	Wait bool
	// Timeout is used to indicate the time to wait for any individual Kubernetes ops
	Timeout string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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