testutil

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TempFile

func TempFile(t *testing.T, contents string) (path string, cleanup func())

func WithEnvVar

func WithEnvVar(key, value string) func()

WithEnvVar sets an env var temporarily. Call its return value in defer to restore original value in env (if exists).

Types

type Context

type Context struct {
	Name    string `yaml:"name,omitempty"`
	Context struct {
		Namespace string `yaml:"namespace,omitempty"`
	} `yaml:"context,omitempty"`
}

func Ctx

func Ctx(name string) *Context

func (*Context) Ns

func (c *Context) Ns(ns string) *Context

type Kubeconfig

type Kubeconfig map[string]interface{}

func KC

func KC() *Kubeconfig

func (*Kubeconfig) Set

func (k *Kubeconfig) Set(key string, v interface{}) *Kubeconfig

func (*Kubeconfig) ToYAML

func (k *Kubeconfig) ToYAML(t *testing.T) string

func (*Kubeconfig) WithCtxs

func (k *Kubeconfig) WithCtxs(c ...*Context) *Kubeconfig

func (*Kubeconfig) WithCurrentCtx

func (k *Kubeconfig) WithCurrentCtx(s string) *Kubeconfig

Jump to

Keyboard shortcuts

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