utils

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PollInterval defines the interval time for a poll operation.
	PollInterval = 250 * time.Millisecond
	// PollTimeout defines the time after which the poll operation times out.
	PollTimeout = 60 * time.Second
)

Functions

func AddByteArrayToManifest

func AddByteArrayToManifest(bytes []byte, manifests []workapi.Manifest) []workapi.Manifest

AddByteArrayToManifest adds a given ByteArray to the manifest for Work Object.

func AddManifests

func AddManifests(objects []runtime.Object, manifests []workapi.Manifest) []workapi.Manifest

AddManifests adds manifests to be included within a Work.

func CheckInternalMemberClusterStatus

func CheckInternalMemberClusterStatus(ctx context.Context, cluster framework.Cluster, objectKey *types.NamespacedName, wantIMCStatus fleetv1alpha1.InternalMemberClusterStatus, imcStatusCmpOptions []cmp.Option)

CheckInternalMemberClusterStatus is used to check internal member cluster status.

func CheckMemberClusterStatus

func CheckMemberClusterStatus(ctx context.Context, cluster framework.Cluster, objectKey *types.NamespacedName, wantMCStatus fleetv1alpha1.MemberClusterStatus, mcStatusCmpOptions []cmp.Option)

CheckMemberClusterStatus is used to check member cluster status.

func CmpClusterRole

func CmpClusterRole(ctx context.Context, cluster framework.Cluster, objectKey *types.NamespacedName, wantClusterRole *rbacv1.ClusterRole, cmpOptions []cmp.Option)

CmpClusterRole compares actual cluster role with expected cluster role.

func CmpNamespace

func CmpNamespace(ctx context.Context, cluster framework.Cluster, objectKey *types.NamespacedName, wantNamespace *corev1.Namespace, cmpOptions []cmp.Option)

CmpNamespace compares actual namespace with expected namespace.

func CmpRole

func CmpRole(ctx context.Context, cluster framework.Cluster, objectKey *types.NamespacedName, wantRole *rbacv1.Role, cmpOptions []cmp.Option)

CmpRole compares actual role with expected role.

func CmpRoleBinding

func CmpRoleBinding(ctx context.Context, cluster framework.Cluster, objectKey *types.NamespacedName, wantRoleBinding *rbacv1.RoleBinding, cmpOptions []cmp.Option)

CmpRoleBinding compares actual role binding with expected role binding.

func CmpSecret

func CmpSecret(ctx context.Context, cluster framework.Cluster, objectKey *types.NamespacedName, wantSecret *corev1.Secret, cmpOptions []cmp.Option) *corev1.Secret

CmpSecret compares actual secret with expected secret and returns actual secret.

func CreateResourcesForWebHookE2E

func CreateResourcesForWebHookE2E(ctx context.Context, hubCluster *framework.Cluster)

CreateResourcesForWebHookE2E create resources required for Webhook E2E.

func CreateWork

func CreateWork(ctx context.Context, hubCluster framework.Cluster, workName, workNamespace string, manifests []workapi.Manifest) workapi.Work

CreateWork creates Work object based on manifest given.

func DeleteClusterResourcePlacement

func DeleteClusterResourcePlacement(ctx context.Context, cluster framework.Cluster, crp *fleetv1alpha1.ClusterResourcePlacement)

DeleteClusterResourcePlacement is used delete ClusterResourcePlacement on the hub cluster.

func DeleteMemberCluster

func DeleteMemberCluster(ctx context.Context, cluster framework.Cluster, mc *fleetv1alpha1.MemberCluster)

DeleteMemberCluster deletes MemberCluster in the hub cluster.

func DeleteNamespace

func DeleteNamespace(ctx context.Context, cluster framework.Cluster, ns *corev1.Namespace)

DeleteNamespace delete namespace.

func DeleteResourcesForWebHookE2E

func DeleteResourcesForWebHookE2E(ctx context.Context, hubCluster *framework.Cluster)

DeleteResourcesForWebHookE2E deletes resources created for Webhook E2E.

func DeleteWork

func DeleteWork(ctx context.Context, hubCluster framework.Cluster, work workapi.Work)

DeleteWork deletes the given Work object and waits until work becomes not found.

func GenerateCRDObjectFromFile

func GenerateCRDObjectFromFile(cluster framework.Cluster, fs embed.FS, filepath string, genericCodec runtime.Decoder) (runtime.Object, *schema.GroupVersionKind, schema.GroupVersionResource)

GenerateCRDObjectFromFile provides the object and gvk from the manifest file given.

func RandomWorkName

func RandomWorkName(length int) string

RandomWorkName creates a work name in a correct format for e2e tests.

func UpdateWork

func UpdateWork(ctx context.Context, hubCluster *framework.Cluster, work *workapi.Work, objects []runtime.Object) *workapi.Work

UpdateWork updates an existing Work Object by replacing the Spec.Manifest with a new objects given from parameter.

func WaitCreateClusterResourcePlacementStatus

func WaitCreateClusterResourcePlacementStatus(ctx context.Context, cluster framework.Cluster, objectKey *types.NamespacedName, wantCRPStatus fleetv1alpha1.ClusterResourcePlacementStatus, crpStatusCmpOptions []cmp.Option, customTimeout time.Duration)

WaitCreateClusterResourcePlacementStatus waits for ClusterResourcePlacement to present on th hub cluster with a specific status.

func WaitWork

func WaitWork(ctx context.Context, cluster framework.Cluster, workName, workNamespace string)

WaitWork waits for Work to be present on the hub cluster.

Types

This section is empty.

Jump to

Keyboard shortcuts

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