utils

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

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 added in v0.6.1

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

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

func AddManifests added in v0.5.6

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

AddManifests adds manifests to be included within a Work.

func CheckInternalMemberClusterStatus added in v0.6.2

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 added in v0.6.2

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 added in v0.6.2

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 added in v0.6.2

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 added in v0.6.2

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 added in v0.6.2

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 added in v0.6.4

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 added in v0.6.5

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

CreateResourcesForWebHookE2E create resources required for Webhook E2E.

func CreateWork added in v0.5.6

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 added in v0.6.5

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

DeleteResourcesForWebHookE2E deletes resources created for Webhook E2E.

func DeleteWork added in v0.5.6

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 added in v0.6.1

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 added in v0.5.6

func RandomWorkName(length int) string

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

func UpdateWork added in v0.5.6

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 added in v0.6.2

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