helmtest

package
v0.0.0-...-284ca22 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

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

Env represents a test environment consisting of a Kubernetes cluster, helm client, and cert-manager installation.

Env's are expected to be Setup infrequently. Ideally, once per test package and then reused via Env.Namespaced and testing.T.Run.

func Setup

func Setup(t *testing.T) *Env

Setup creates a new Env using whatever cluster is available in KUBECONFIG.

func (*Env) Ctl

func (e *Env) Ctl() *kube.Ctl

func (*Env) Namespaced

func (e *Env) Namespaced(t *testing.T) *NamespacedEnv

Namespaced creates a sandboxed Kubernetes namespace that will be cleaned up at the end of `t`. Usage:

t.Run('subtest', func(t *testing.T) {
	env := env.Namespaced(t)
	// Testing....
})

type NamespacedEnv

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

NamespacedEnv is effectively an Env that is bound to a specific Kubernetes Namespace. It exposes convenience methods for common operations without the need to set .Namespace or check errors.

func (*NamespacedEnv) Ctl

func (e *NamespacedEnv) Ctl() *kube.Ctl

func (*NamespacedEnv) Install

func (e *NamespacedEnv) Install(chart string, opts helm.InstallOptions) helm.Release

func (*NamespacedEnv) Namespace

func (e *NamespacedEnv) Namespace() string

func (*NamespacedEnv) Test

func (e *NamespacedEnv) Test(release helm.Release)

func (*NamespacedEnv) Upgrade

func (e *NamespacedEnv) Upgrade(chart string, release helm.Release, opts helm.UpgradeOptions) helm.Release

Jump to

Keyboard shortcuts

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