test

package
v1.23.4 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: Apache-2.0 Imports: 19 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 AssertNodesHadUpgradeTriggered added in v1.23.0

func AssertNodesHadUpgradeTriggered(c kubernetes.Interface, nodes ...*v1.Node) error

func AssertNodesUnchanged added in v1.23.0

func AssertNodesUnchanged(c kubernetes.Interface, nodes ...*v1.Node) error

func CreateNode added in v1.23.0

func CreateNode(c kubernetes.Interface, name string, labels map[string]string, annotations map[string]string) *v1.Node

func CreateWindowsNode added in v1.23.0

func CreateWindowsNode(cs kubernetes.Interface, name string, variant operator.ProductVariant, version string) *v1.Node

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 NewNodeListWatch added in v1.23.0

func NewNodeListWatch(cs kubernetes.Interface) nodeListWatch

func NewTyphaListWatch added in v1.23.0

func NewTyphaListWatch(cs kubernetes.Interface) typhaListWatch

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