checker

package
v0.0.0-...-6a4f5cd Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 26 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Scheme = runtime.NewScheme()
)

Functions

func FromJSON

func FromJSON[O interface{}](str string) O

func FromYAML

func FromYAML[O interface{}](str string) O

func Get

func Get[K comparable, V interface{}](tc *TestContext, key K) (V, bool)

func HasAnnotations

func HasAnnotations[O metav1.Object](obj O, labels map[string]string) error

func HasLabels

func HasLabels[O metav1.Object](obj O, labels map[string]string) error

func Key

func Key[O metav1.Object](obj O) relatedresource.Key

func MapFor

func MapFor[M comparable, K comparable, V interface{}](tc *TestContext, mapKey M, doFunc func(K, V))

func MapGet

func MapGet[M comparable, K comparable, V interface{}](tc *TestContext, mapKey M, key K) (V, bool)

func MapSet

func MapSet[M comparable, K comparable, V interface{}](tc *TestContext, mapKey M, key K, value V)

func MatchAnnotations

func MatchAnnotations[O metav1.Object](obj O, labels map[string]string) error

func MatchLabels

func MatchLabels[O metav1.Object](obj O, labels map[string]string) error

func MustRenderValue

func MustRenderValue[O interface{}](tc *TestContext, path string) O

func RenderValue

func RenderValue[O interface{}](tc *TestContext, path string) (O, bool)

func Select

func Select[O metav1.Object](name string, namespace string, obj O) bool

func Store

func Store[K comparable, V interface{}](tc *TestContext, key K, value V)

func ToJSON

func ToJSON[O interface{}](obj O) string

func ToYAML

func ToYAML[O interface{}](obj O) string

Types

type ChainedCheckFunc

type ChainedCheckFunc func(t *TestContext) CheckFunc

func NewChainedCheckFunc

func NewChainedCheckFunc[S interface{}](checkFuncWithContext func(tc *TestContext, objStruct S)) ChainedCheckFunc

func OnResources

func OnResources[O metav1.Object](typedListCheckFunc func(tc *TestContext, objects []O)) ChainedCheckFunc

func OnWorkloads

func OnWorkloads(typedCheckFunc func(tc *TestContext, podTemplateSpecs map[metav1.Object]corev1.PodTemplateSpec)) ChainedCheckFunc

func Once

func Once(checkFunc func(tc *TestContext)) ChainedCheckFunc

func PerResource

func PerResource[O metav1.Object](typedCheckFunc func(tc *TestContext, object O)) ChainedCheckFunc

func PerWorkload

func PerWorkload(typedCheckFunc func(tc *TestContext, obj metav1.Object, podTemplateSpec corev1.PodTemplateSpec)) ChainedCheckFunc

type CheckFunc

type CheckFunc interface{}

func NewCheckFunc

func NewCheckFunc(funcs ...ChainedCheckFunc) CheckFunc

type Checker

type Checker interface {
	Check(t *testing.T, objStructFunc CheckFunc)
}

func NewChecker

func NewChecker(osMap map[string]*objectset.ObjectSet) (Checker, error)

func NewCheckerFromObjectSet

func NewCheckerFromObjectSet(os *objectset.ObjectSet, name string) (Checker, error)

func NewCheckerFromString

func NewCheckerFromString(rawYaml string, name string) (Checker, error)

type TestContext

type TestContext struct {
	T *testing.T

	Data map[interface{}]interface{}

	RenderValues helmChartUtil.Values
	// contains filtered or unexported fields
}

func NewContext

func NewContext() *TestContext

func (*TestContext) Continue

func (tc *TestContext) Continue()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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