helpers

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterRegistrarFinalizer  string = "clusterregistrar.open-cluster-management.io/cleanup"
	RegisteredClusterFinalizer string = "registeredcluster.open-cluster-management.io/cleanup"
)

Variables

View Source
var (
	GvrCR schema.GroupVersionResource = schema.GroupVersionResource{
		Group:    "singapore.open-cluster-management.io",
		Version:  "v1alpha1",
		Resource: "clusterregistrars"}
)

Functions

func GetConditionStatus

func GetConditionStatus(conditions []metav1.Condition, t string) (status metav1.ConditionStatus, ok bool)

GetConditionStatus returns the status for a given condition type and whether the condition was found

func GetSyncerName

func GetSyncerName(regClusterName string) string

func GetSyncerPrefix

func GetSyncerPrefix() string

func GetSyncerServiceAccountName

func GetSyncerServiceAccountName() string

func ManagedClusterSetNameForWorkspace

func ManagedClusterSetNameForWorkspace(workspaceName string) string

func MergeStatusConditions

func MergeStatusConditions(conditions []metav1.Condition, newConditions ...metav1.Condition) []metav1.Condition

MergeStatusConditions returns a new status condition array with merged status conditions. It is based on newConditions, and merges the corresponding existing conditions if exists.

func RandomString

func RandomString(strSize int, randType RandomType) string

func RestConfigForAPIExport

func RestConfigForAPIExport(ctx context.Context, cfg *rest.Config, apiExportName string, scheme *runtime.Scheme) (*rest.Config, error)

restConfigForAPIExport returns a *rest.Config properly configured to communicate with the endpoint for the APIExport's virtual workspace.

Types

type HubInstance

type HubInstance struct {
	HubConfig      *singaporev1alpha1.HubConfig
	Cluster        cluster.Cluster
	Client         client.Client
	ApplierBuilder *clusteradmapply.ApplierBuilder
}

func GetHubCluster

func GetHubCluster(workspace string, hubInstances []HubInstance) (HubInstance, error)

func GetHubClusters

func GetHubClusters(ctx context.Context, mgr ctrl.Manager, kubeClient kubernetes.Interface, dynamicClient dynamic.Interface) ([]HubInstance, error)

type RandomType

type RandomType string
const (
	RandomTypeNumber   RandomType = "number"
	RandomTypeAlpha    RandomType = "alpha"
	RandomTypeAlphaNum RandomType = "alphanum"
	RandomTypePassword RandomType = "password"
)

Jump to

Keyboard shortcuts

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