utils

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 14 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 = 5 * time.Second
	// PollTimeout defines the time after which the poll operation times out.
	PollTimeout = 60 * time.Second
)

Functions

func CreateClusterResourcePlacement

func CreateClusterResourcePlacement(cluster framework.Cluster, crp *v1alpha1.ClusterResourcePlacement)

CreateClusterResourcePlacement created ClusterResourcePlacement and waits for ClusterResourcePlacement to exist in hub cluster.

func CreateClusterRole

func CreateClusterRole(cluster framework.Cluster, cr *rbacv1.ClusterRole)

CreateClusterRole create cluster role in the hub cluster.

func CreateMemberCluster

func CreateMemberCluster(cluster framework.Cluster, mc *v1alpha1.MemberCluster)

CreateMemberCluster creates MemberCluster and waits for MemberCluster to exist in the hub cluster.

func CreateNamespace

func CreateNamespace(cluster framework.Cluster, ns *corev1.Namespace)

CreateNamespace create namespace and waits for namespace to exist.

func CreateServiceAccount

func CreateServiceAccount(cluster framework.Cluster, sa *corev1.ServiceAccount)

CreateServiceAccount create serviceaccount.

func DeleteClusterResourcePlacement

func DeleteClusterResourcePlacement(cluster framework.Cluster, crp *v1alpha1.ClusterResourcePlacement)

DeleteClusterResourcePlacement is used delete ClusterResourcePlacement on the hub cluster.

func DeleteClusterRole

func DeleteClusterRole(cluster framework.Cluster, cr *rbacv1.ClusterRole)

DeleteClusterRole deletes cluster role on cluster.

func DeleteMemberCluster

func DeleteMemberCluster(cluster framework.Cluster, mc *v1alpha1.MemberCluster)

DeleteMemberCluster deletes MemberCluster in the hub cluster.

func DeleteNamespace

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

DeleteNamespace delete namespace.

func DeleteServiceAccount

func DeleteServiceAccount(cluster framework.Cluster, sa *corev1.ServiceAccount)

DeleteServiceAccount delete serviceaccount.

func NewInternalMemberCluster

func NewInternalMemberCluster(name, namespace string) *v1alpha1.InternalMemberCluster

NewInternalMemberCluster returns a new internal member cluster.

func NewMemberCluster

func NewMemberCluster(name string, heartbeat int32, state v1alpha1.ClusterState) *v1alpha1.MemberCluster

NewMemberCluster return a new member cluster.

func NewNamespace

func NewNamespace(name string) *corev1.Namespace

NewNamespace returns a new namespace.

func NewServiceAccount

func NewServiceAccount(name, namespace string) *corev1.ServiceAccount

NewServiceAccount returns a new service account.

func UpdateMemberClusterState

func UpdateMemberClusterState(cluster framework.Cluster, mc *v1alpha1.MemberCluster, state v1alpha1.ClusterState)

UpdateMemberClusterState updates MemberCluster in the hub cluster.

func WaitClusterRole

func WaitClusterRole(cluster framework.Cluster, cr *rbacv1.ClusterRole)

WaitClusterRole waits for cluster roles to be created.

func WaitConditionClusterResourcePlacement

func WaitConditionClusterResourcePlacement(cluster framework.Cluster, crp *v1alpha1.ClusterResourcePlacement,
	conditionName string, status metav1.ConditionStatus, customTimeout time.Duration)

WaitConditionClusterResourcePlacement waits for ClusterResourcePlacement to present on th hub cluster with a specific condition.

func WaitConditionInternalMemberCluster

func WaitConditionInternalMemberCluster(cluster framework.Cluster, imc *v1alpha1.InternalMemberCluster, conditionType v1alpha1.AgentConditionType, status metav1.ConditionStatus, customTimeout time.Duration)

WaitConditionInternalMemberCluster waits for InternalMemberCluster to present on the hub cluster with a specific condition. Allowing custom timeout as for join cond it needs longer than defined PollTimeout for the member agent to finish joining.

func WaitConditionMemberCluster

func WaitConditionMemberCluster(cluster framework.Cluster, mc *v1alpha1.MemberCluster, conditionName string, status metav1.ConditionStatus, customTimeout time.Duration)

WaitConditionMemberCluster waits for MemberCluster to present on th hub cluster with a specific condition.

func WaitInternalMemberCluster

func WaitInternalMemberCluster(cluster framework.Cluster, imc *v1alpha1.InternalMemberCluster)

WaitInternalMemberCluster waits for InternalMemberCluster to present on th hub cluster.

func WaitWork

func WaitWork(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