translate

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 7 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NamespaceLabel = "vcluster.loft.sh/namespace"
	MarkerLabel    = "vcluster.loft.sh/managed-by"
	Suffix         = "suffix"
)
View Source
var OwningStatefulSet *appsv1.StatefulSet

Functions

func ConvertLabelKey added in v0.3.0

func ConvertLabelKey(key string) string

func ConvertNamespacedLabelKey added in v0.4.0

func ConvertNamespacedLabelKey(physicalNamespace, key string) string

func EqualExcept

func EqualExcept(a map[string]string, b map[string]string, except ...string) bool

func IsManaged

func IsManaged(obj runtime.Object) bool

func IsManagedCluster added in v0.4.0

func IsManagedCluster(physicalNamespace string, obj runtime.Object) bool

func LabelsClusterEqual added in v0.4.0

func LabelsClusterEqual(physicalNamespace string, virtualLabels map[string]string, physicalLabels map[string]string) bool

func LabelsEqual added in v0.3.0

func LabelsEqual(virtualNamespace string, virtualLabels map[string]string, physicalLabels map[string]string) bool

func NamespaceLabelValue added in v0.3.0

func NamespaceLabelValue(virtualNamespace string) string

func ObjectPhysicalName

func ObjectPhysicalName(obj runtime.Object) string

ObjectPhysicalName returns the translated physical name of this object

func PhysicalName

func PhysicalName(name, namespace string) string

PhysicalName returns the physical name of the name / namespace resource

func PhysicalNameClusterScoped added in v0.4.0

func PhysicalNameClusterScoped(name, physicalNamespace string) string

PhysicalNameClusterScoped returns the physical name of a cluster scoped object in the host cluster

func ResetObjectMetadata

func ResetObjectMetadata(obj metav1.Object)

ResetObjectMetadata resets the objects metadata except name, namespace and annotations

func SafeConcatGenerateName added in v0.3.0

func SafeConcatGenerateName(name ...string) string

func SafeConcatName

func SafeConcatName(name ...string) string

func SetExcept

func SetExcept(from map[string]string, to map[string]string, except ...string) map[string]string

func SetupMetadata

func SetupMetadata(targetNamespace string, obj runtime.Object) (runtime.Object, error)

func SetupMetadataCluster added in v0.4.0

func SetupMetadataCluster(targetNamespace string, vObj runtime.Object, translator PhysicalNameTranslator) (runtime.Object, error)

func Split

func Split(s, sep string) (string, string)

func TranslateLabelSelector added in v0.3.0

func TranslateLabelSelector(labelSelector *metav1.LabelSelector) *metav1.LabelSelector

func TranslateLabelSelectorCluster added in v0.4.0

func TranslateLabelSelectorCluster(physicalNamespace string, labelSelector *metav1.LabelSelector) *metav1.LabelSelector

func TranslateLabels added in v0.3.0

func TranslateLabels(virtualNamespace string, labels map[string]string) map[string]string

TranslateLabels transforms the virtual labels into physical ones

func TranslateLabelsCluster added in v0.4.0

func TranslateLabelsCluster(physicalNamespace string, labels map[string]string) map[string]string

TranslateLabelsCluster transforms the virtual labels into physical ones

func UniqueSlice

func UniqueSlice(stringSlice []string) []string

Types

type PhysicalNameTranslator added in v0.4.0

type PhysicalNameTranslator interface {
	PhysicalName(vName string, vObj runtime.Object) string
}

Jump to

Keyboard shortcuts

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