test

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNonZeroInt64   int64   = 1
	DefaultNonZeroUint64  uint64  = 1
	DefaultNonZeroFloat64 float64 = 1
	DefaultNonZeroString  string  = "not-zero"
	DefaultNonZeroBool    bool    = true
)

Variables

This section is empty.

Functions

func ExpectResourceCreated

func ExpectResourceCreated(c client.Client, obj client.Object)

ExpectResourceCreated asserts that the given object is created, and populates the provided client.Object with the current state of the object in the cluster.

func ExpectResourceDestroyed

func ExpectResourceDestroyed(c client.Client, obj client.Object)

ExpectResourceDestroyed asserts that the given object no longer exists.

func GetContainer added in v1.14.0

func GetContainer(containers []v1.Container, name string) *v1.Container

func GetResource

func GetResource(c client.Client, obj client.Object) error

GetResource gets the requested object, populating obj with its contents.

func MakeTestCA added in v1.14.0

func MakeTestCA(signer string) *crypto.CA

func RunOperator

func RunOperator(mgr manager.Manager, ctx context.Context) (doneChan chan struct{})

RunOperator runs the provided operator manager in a separate goroutine so that the test code isn't blocked. The passed in stop channel can be closed in order to stop the execution of the operator. The channel returned will be closed when the mgr stops.

func VerifyCert added in v1.14.0

func VerifyCert(secret *v1.Secret, privKey string, pubKey string, expectedSANs ...string)

func VerifyCertSANs added in v1.14.0

func VerifyCertSANs(certBytes []byte, expectedSANs ...string)

func VerifyPublicCert added in v1.14.0

func VerifyPublicCert(secret *v1.Secret, pubKey string, expectedSANs ...string)

Types

type NonZeroDefaultOption added in v1.12.0

type NonZeroDefaultOption func(defaulter *nonZeroValueDefaulter)

func WithInterfaceImplementations added in v1.12.0

func WithInterfaceImplementations(ifaceImpls map[string]interface{}) NonZeroDefaultOption

type ValueDefaulter added in v1.12.0

type ValueDefaulter interface {
	SetDefault(interface{}) error
}

func NewNonZeroStructDefaulter added in v1.12.0

func NewNonZeroStructDefaulter(options ...NonZeroDefaultOption) ValueDefaulter

NewNonZeroStructDefaulter creates an implementation of the ValueDefaulter that

Jump to

Keyboard shortcuts

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