addontesting

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertActions

func AssertActions(t *testing.T, actualActions []clienttesting.Action, expectedVerbs ...string)

AssertActions asserts the actual actions have the expected action verb

func AssertNoActions

func AssertNoActions(t *testing.T, actualActions []clienttesting.Action)

AssertNoActions asserts no actions are happened

func DeleteManagedCluster added in v0.4.0

func DeleteManagedCluster(c *clusterv1.ManagedCluster) *clusterv1.ManagedCluster

func NewAddon

func NewAddon(name, namespace string, owners ...metav1.OwnerReference) *addonapiv1alpha1.ManagedClusterAddOn

func NewAddonWithConditions added in v0.7.0

func NewAddonWithConditions(name, namespace string, conditions ...metav1.Condition) *addonapiv1alpha1.ManagedClusterAddOn

func NewApprovedCSR

func NewApprovedCSR(addon, cluster string) *certv1.CertificateSigningRequest

func NewApprovedV1beta1CSR added in v0.3.0

func NewApprovedV1beta1CSR(addon, cluster string) *certv1beta1.CertificateSigningRequest

func NewCSR

func NewCSR(addon, cluster string) *certv1.CertificateSigningRequest

func NewClusterManagementAddon

func NewClusterManagementAddon(name, crd, cr string) *clusterManagementAddonBuilder

func NewDeniedCSR

func NewDeniedCSR(addon, cluster string) *certv1.CertificateSigningRequest

func NewDeniedV1beta1CSR added in v0.3.0

func NewDeniedV1beta1CSR(addon, cluster string) *certv1beta1.CertificateSigningRequest

func NewHookJob added in v0.5.0

func NewHookJob(name, namespace string) *unstructured.Unstructured

func NewHostedHookJob added in v0.5.0

func NewHostedHookJob(name, namespace string) *unstructured.Unstructured

func NewHostedModeAddon added in v0.5.0

func NewHostedModeAddon(name, namespace string, hostingCluster string,
	conditions ...metav1.Condition) *addonapiv1alpha1.ManagedClusterAddOn

func NewHostedModeAddonWithFinalizer added in v0.5.0

func NewHostedModeAddonWithFinalizer(name, namespace string, hostingCluster string,
	conditions ...metav1.Condition) *addonapiv1alpha1.ManagedClusterAddOn

func NewHostingUnstructured added in v0.5.0

func NewHostingUnstructured(apiVersion, kind, namespace, name string) *unstructured.Unstructured

func NewManagedCluster

func NewManagedCluster(name string) *clusterv1.ManagedCluster

func NewManifestWork

func NewManifestWork(name, namespace string, objects ...*unstructured.Unstructured) *workapiv1.ManifestWork

func NewTestingEventRecorder added in v0.4.0

func NewTestingEventRecorder(t *testing.T) events.Recorder

NewTestingEventRecorder provides event recorder that will log all recorded events to the error log.

func NewUnstructured

func NewUnstructured(apiVersion, kind, namespace, name string) *unstructured.Unstructured

func NewV1beta1CSR added in v0.3.0

func NewV1beta1CSR(addon, cluster string) *certv1beta1.CertificateSigningRequest

func SetAddonDeletionTimestamp added in v0.5.0

func SetAddonDeletionTimestamp(addon *addonapiv1alpha1.ManagedClusterAddOn,
	deletionTimestamp time.Time) *addonapiv1alpha1.ManagedClusterAddOn

func SetAddonFinalizers added in v0.5.0

func SetAddonFinalizers(addon *addonapiv1alpha1.ManagedClusterAddOn, finalizers ...string) *addonapiv1alpha1.ManagedClusterAddOn

func SetManagedClusterAnnotation added in v0.5.0

func SetManagedClusterAnnotation(c *clusterv1.ManagedCluster,
	annotations map[string]string) *clusterv1.ManagedCluster

Types

type FakeSyncContext

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

func NewFakeSyncContext

func NewFakeSyncContext(t *testing.T) *FakeSyncContext

func (FakeSyncContext) Queue

func (FakeSyncContext) Recorder

func (f FakeSyncContext) Recorder() events.Recorder

type TestingEventRecorder added in v0.4.0

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

func (*TestingEventRecorder) ComponentName added in v0.4.0

func (r *TestingEventRecorder) ComponentName() string

func (*TestingEventRecorder) Event added in v0.4.0

func (r *TestingEventRecorder) Event(reason, message string)

func (*TestingEventRecorder) Eventf added in v0.4.0

func (r *TestingEventRecorder) Eventf(reason, messageFmt string, args ...interface{})

func (*TestingEventRecorder) ForComponent added in v0.4.0

func (r *TestingEventRecorder) ForComponent(c string) events.Recorder

func (*TestingEventRecorder) Shutdown added in v0.4.0

func (r *TestingEventRecorder) Shutdown()

func (*TestingEventRecorder) Warning added in v0.4.0

func (r *TestingEventRecorder) Warning(reason, message string)

func (*TestingEventRecorder) Warningf added in v0.4.0

func (r *TestingEventRecorder) Warningf(reason, messageFmt string, args ...interface{})

func (*TestingEventRecorder) WithComponentSuffix added in v0.4.0

func (r *TestingEventRecorder) WithComponentSuffix(suffix string) events.Recorder

func (*TestingEventRecorder) WithContext added in v0.4.0

func (r *TestingEventRecorder) WithContext(ctx context.Context) events.Recorder

Jump to

Keyboard shortcuts

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