testing

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TrackerKey key = struct{}{}

TrackerKey is used to looking a FakeTracker in a context.Context

Functions

func AssertTrackingObject

func AssertTrackingObject(gvk schema.GroupVersionKind, namespace, name string) func(*testing.T, *reconcilertesting.TableRow)

AssertTrackingObject will ensure the following objects are being tracked

func AssertTrackingSecret

func AssertTrackingSecret(namespace, name string) func(*testing.T, *reconcilertesting.TableRow)

AssertTrackingSecret will ensure the provided Secret is being tracked

func MakeFactory

func MakeFactory(ctor Ctor, unstructured bool, logger *zap.SugaredLogger, privKMSKey *ecdsa.PrivateKey) reconcilertesting.Factory

MakeFactory creates a reconciler factory with fake clients and controller created by `ctor`.

func NewClusterImagePolicy

func NewClusterImagePolicy(name string, o ...ClusterImagePolicyOption) *v1alpha1.ClusterImagePolicy

NewClusterImagePolicy creates a ClusterImagePolicy with ClusterImagePolicyOptions.

func NewScheme

func NewScheme() *runtime.Scheme

func ToUnstructured

func ToUnstructured(t *testing.T, objs []runtime.Object) (us []runtime.Object)

ToUnstructured takes a list of k8s resources and converts them to Unstructured objects. We must pass objects as Unstructured to the dynamic client fake, or it won't handle them properly.

func WithClusterImagePolicyDeletionTimestamp

func WithClusterImagePolicyDeletionTimestamp(cip *v1alpha1.ClusterImagePolicy)

func WithFinalizer

func WithFinalizer(cip *v1alpha1.ClusterImagePolicy)

Types

type ClusterImagePolicyOption

type ClusterImagePolicyOption func(*v1alpha1.ClusterImagePolicy)

ClusterImagePolicyOption enables further configuration of a ClusterImagePolicy.

type Ctor

Ctor functions create a k8s controller with given params.

type Listers

type Listers struct {
	// contains filtered or unexported fields
}

func NewListers

func NewListers(objs []runtime.Object) Listers

func (*Listers) GetAllObjects

func (l *Listers) GetAllObjects() []runtime.Object

func (*Listers) GetClusterImagePolicyLister

func (l *Listers) GetClusterImagePolicyLister() cosignlisters.ClusterImagePolicyLister

func (*Listers) GetConfigMapLister

func (l *Listers) GetConfigMapLister() corev1listers.ConfigMapLister

func (*Listers) GetCosignObjects

func (l *Listers) GetCosignObjects() []runtime.Object

func (*Listers) GetKubeObjects

func (l *Listers) GetKubeObjects() []runtime.Object

func (*Listers) GetSecretLister

func (l *Listers) GetSecretLister() corev1listers.SecretLister

Jump to

Keyboard shortcuts

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