util

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertAppliedManifestWorkDeleted

func AssertAppliedManifestWorkDeleted(name string, workClient workclientset.Interface, eventuallyTimeout, eventuallyInterval int)

func AssertAppliedResources

func AssertAppliedResources(hubHash, workName string, gvrs []schema.GroupVersionResource, namespaces, names []string, workClient workclientset.Interface, eventuallyTimeout, eventuallyInterval int)

check if applied resources in work status are updated correctly

func AssertExistenceOfConfigMaps

func AssertExistenceOfConfigMaps(manifests []workapiv1.Manifest, kubeClient kubernetes.Interface, eventuallyTimeout, eventuallyInterval int)

check if all manifests are applied

func AssertExistenceOfResources

func AssertExistenceOfResources(gvrs []schema.GroupVersionResource, namespaces, names []string, dynamicClient dynamic.Interface, eventuallyTimeout, eventuallyInterval int)

check the existence of resource with GVR, namespace and name

func AssertFinalizerAdded

func AssertFinalizerAdded(namespace, name string, workClient workclientset.Interface, eventuallyTimeout, eventuallyInterval int)

check if finalizer is added

func AssertNonexistenceOfResources

func AssertNonexistenceOfResources(gvrs []schema.GroupVersionResource, namespaces, names []string, dynamicClient dynamic.Interface, eventuallyTimeout, eventuallyInterval int)

check if resource with GVR, namespace and name does not exists

func AssertWorkCondition

func AssertWorkCondition(namespace, name string, workClient workclientset.Interface, expectedType string, expectedWorkStatus metav1.ConditionStatus,
	expectedManifestStatuses []metav1.ConditionStatus, eventuallyTimeout, eventuallyInterval int)

func AssertWorkDeleted

func AssertWorkDeleted(namespace, name, hubhash string, manifests []workapiv1.Manifest, workClient workclientset.Interface, kubeClient kubernetes.Interface, eventuallyTimeout, eventuallyInterval int)

check if work is deleted

func AssertWorkGeneration added in v0.5.0

func AssertWorkGeneration(namespace, name string, workClient workclientset.Interface, expectedType string, eventuallyTimeout, eventuallyInterval int)

func CreateKubeconfigFile

func CreateKubeconfigFile(clientConfig *rest.Config, filename string) error

func GetResource

func GetResource(namespace, name string, gvr schema.GroupVersionResource, dynamicClient dynamic.Interface) (*unstructured.Unstructured, error)

func GuestbookCr

func GuestbookCr(namespace, name string) (cr *unstructured.Unstructured, gvr schema.GroupVersionResource, err error)

func GuestbookCrd

func GuestbookCrd() (crd *unstructured.Unstructured, gvr schema.GroupVersionResource, err error)

func HaveManifestCondition

func HaveManifestCondition(conditions []workapiv1.ManifestCondition, expectedType string, expectedStatuses []metav1.ConditionStatus) bool

func NewConfigmap

func NewConfigmap(namespace, name string, data map[string]string, finalizers []string) *corev1.ConfigMap

func NewDeployment

func NewDeployment(namespace, name, sa string) (u *unstructured.Unstructured, gvr schema.GroupVersionResource, err error)

func NewIntegrationTestEventRecorder

func NewIntegrationTestEventRecorder(componet string) events.Recorder

func NewManifestWork

func NewManifestWork(namespace, name string, manifests []workapiv1.Manifest) *workapiv1.ManifestWork

func NewRole

func NewRole(namespace, name string) (*unstructured.Unstructured, schema.GroupVersionResource)

func NewRoleBinding

func NewRoleBinding(namespace, name, sa, role string) (*unstructured.Unstructured, schema.GroupVersionResource)

func NewServiceAccount

func NewServiceAccount(namespace, name string) (*unstructured.Unstructured, schema.GroupVersionResource)

func ToManifest

func ToManifest(object runtime.Object) workapiv1.Manifest

Types

type IntegrationTestEventRecorder

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

func (*IntegrationTestEventRecorder) ComponentName

func (r *IntegrationTestEventRecorder) ComponentName() string

func (*IntegrationTestEventRecorder) Event

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

func (*IntegrationTestEventRecorder) Eventf

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

func (*IntegrationTestEventRecorder) ForComponent

func (*IntegrationTestEventRecorder) Shutdown

func (r *IntegrationTestEventRecorder) Shutdown()

func (*IntegrationTestEventRecorder) Warning

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

func (*IntegrationTestEventRecorder) Warningf

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

func (*IntegrationTestEventRecorder) WithComponentSuffix

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

Jump to

Keyboard shortcuts

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