common

package
v0.0.0-...-79f7c74 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UpdateBaselines bool

Functions

func Contains

func Contains(str string, list []string) bool

func CreateConfigMap

func CreateConfigMap(t *testing.T, kubectlOptions *k8s.KubectlOptions, configMapName string, data map[string]string) (cleanupFunc func())

CreateConfigMap creates a Kubernetes configmap with the given name and key-value pairs

func CreateSecret

func CreateSecret(t *testing.T, kubectlOptions *k8s.KubectlOptions, secretName string, data map[string]string) (cleanupFunc func())

CreateSecret creates a Kubernetes secret with the given name and key-value pairs

func CreateSecretFromEnv

func CreateSecretFromEnv(t *testing.T, kubectlOptions *k8s.KubectlOptions, apiKeyEnv, appKeyEnv string) (cleanupFunc func())

CreateSecretFromEnv creates a Kubernetes secret from environment variables

func CurrentContext

func CurrentContext(t *testing.T) string

func FilterYamlKeysMultiManifest

func FilterYamlKeysMultiManifest(manifest string, filterKeys map[string]interface{}) (string, error)

FilterYamlKeysMultiManifest Takes multi-document YAML and filter out keys from each document.

func GetVolumeNames

func GetVolumeNames(ds appsv1.DaemonSet) []string

func InstallChart

func InstallChart(t *testing.T, kubectlOptions *k8s.KubectlOptions, cmd HelmCommand) (cleanupFunc func())

func LoadFromFile

func LoadFromFile[T any](t *testing.T, filepath string, destObj *T) string

func ParseArgs

func ParseArgs()

func ReadFile

func ReadFile(t *testing.T, filepath string) string

func RenderChart

func RenderChart(t *testing.T, cmd HelmCommand) (string, error)

func SetupConfig

func SetupConfig() (runner.ConfigMap, error)

func Unmarshal

func Unmarshal[T any](t *testing.T, manifest string, destObj *T)

func WriteToFile

func WriteToFile(t *testing.T, filepath, content string)

Types

type HelmCommand

type HelmCommand struct {
	ReleaseName   string
	Namespace     string
	ChartPath     string
	Remote        bool              // if true, ChartPath is a remote chart reference (e.g. "repo/chart") and is used as-is
	Version       string            // chart version; only used when Remote is true
	ShowOnly      []string          // helm template `-s, --show-only` flag
	Values        []string          // helm template `-f, --values` flag
	Overrides     map[string]string // helm template `--set` flag
	OverridesJson map[string]string // helm template `--set-json` flag
	Logger        *logger.Logger    // logger to use for helm output. Set to logger.Discard by default.
	ExtraArgs     []string
}

Jump to

Keyboard shortcuts

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