shared

package
v0.5.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamespaceLocatorAnnotation = "kcp.dev/namespace-locator"
)
View Source
const (
	// SyncerFinalizerNamePrefix is the finalizer put onto resources by the syncer to claim ownership,
	// *before* a downstream object is created. It is only removed when the downstream object is deleted.
	SyncerFinalizerNamePrefix = "workloads.kcp.dev/syncer-"
)

Variables

This section is empty.

Functions

func DeprecatedGetAssignedWorkloadCluster deprecated

func DeprecatedGetAssignedWorkloadCluster(labels map[string]string) string

DeprecatedGetAssignedWorkloadCluster returns one assigned workload cluster in Sync state. It will likely lead to broken behaviour when there is one of those labels on a resource.

Deprecated: use GetResourceState per cluster instead.

func EnsureUpstreamFinalizerRemoved

func EnsureUpstreamFinalizerRemoved(ctx context.Context, gvr schema.GroupVersionResource, upstreamClient dynamic.ClusterInterface, upstreamNamespace, workloadClusterName string, logicalClusterName logicalcluster.Name, resourceName string) error

func PhysicalClusterNamespaceName

func PhysicalClusterNamespaceName(l NamespaceLocator) (string, error)

PhysicalClusterNamespaceName encodes the NamespaceLocator to a new namespace name for use on a physical cluster. The encoding is repeatable.

Types

type NamespaceLocator

type NamespaceLocator struct {
	LogicalCluster logicalcluster.Name `json:"logical-cluster"`
	Namespace      string              `json:"namespace"`
}

NamespaceLocator stores a logical cluster and namespace and is used as the source for the mapped namespace name in a physical cluster.

func LocatorFromAnnotations

func LocatorFromAnnotations(annotations map[string]string) (*NamespaceLocator, error)

Jump to

Keyboard shortcuts

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