labels

package
v1.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package labels label selectors used throughout the liqo code in order to get k8s resources.

Index

Constants

This section is empty.

Variables

View Source
var (
	// IPAMStorageLabelSelector selector used to get the ipam storage instance.
	IPAMStorageLabelSelector = metav1.LabelSelector{
		MatchExpressions: []metav1.LabelSelectorRequirement{
			{
				Key:      liqoconst.IpamStorageResourceLabelKey,
				Operator: metav1.LabelSelectorOpIn,
				Values:   []string{liqoconst.IpamStorageResourceLabelValue},
			},
		},
	}

	// ClusterIDConfigMapLabelSelector selector used to get the cluster id configmap.
	ClusterIDConfigMapLabelSelector = metav1.LabelSelector{
		MatchExpressions: []metav1.LabelSelectorRequirement{
			{
				Key:      liqoconst.K8sAppNameKey,
				Operator: metav1.LabelSelectorOpIn,
				Values:   []string{liqoconst.ClusterIDConfigMapNameLabelValue},
			},
		},
	}

	// ProxyServiceLabelSelector selector used to get the gateway service.
	ProxyServiceLabelSelector = metav1.LabelSelector{
		MatchExpressions: []metav1.LabelSelectorRequirement{
			{
				Key:      liqoconst.K8sAppNameKey,
				Operator: metav1.LabelSelectorOpIn,
				Values:   []string{liqoconst.APIServerProxyAppName},
			},
		},
	}

	// GatewayResourceLabelSelector selector is used to get resources related to a gateway.
	GatewayResourceLabelSelector = metav1.LabelSelector{
		MatchExpressions: []metav1.LabelSelectorRequirement{
			{
				Key:      liqoconst.GatewayResourceLabel,
				Operator: metav1.LabelSelectorOpIn,
				Values:   []string{liqoconst.GatewayResourceLabelValue},
			},
		},
	}

	// ResourceForRemoteClusterLabelSelector selector is used to get resources related to a remote cluster.
	ResourceForRemoteClusterLabelSelector = metav1.LabelSelector{
		MatchExpressions: []metav1.LabelSelectorRequirement{
			{
				Key:      liqoconst.RemoteClusterID,
				Operator: metav1.LabelSelectorOpExists,
			},
		},
	}
)

Functions

func ComponentLabelSelector added in v0.6.0

func ComponentLabelSelector(name, component string) labels.Selector

ComponentLabelSelector returns the label selector associated with the component characterized by the given name and component labels.

func ControllerManagerLabelSelector added in v0.6.0

func ControllerManagerLabelSelector() labels.Selector

ControllerManagerLabelSelector returns the label selector associated with the controller-manager components.

func LocalLabelSelector added in v0.5.0

func LocalLabelSelector() labels.Selector

LocalLabelSelector returns a label selector to match local resources.

func LocalLabelSelectorForCluster added in v0.6.0

func LocalLabelSelectorForCluster(destinationClusterID string) labels.Selector

LocalLabelSelectorForCluster returns a label selector to match local resources with a given destination ClusterID.

func RemoteLabelSelector added in v0.5.0

func RemoteLabelSelector() labels.Selector

RemoteLabelSelector returns a label selector to match local resources.

func RemoteLabelSelectorForCluster added in v0.6.0

func RemoteLabelSelectorForCluster(originClusterID string) labels.Selector

RemoteLabelSelectorForCluster returns a label selector to match remote resources with a given origin ClusterID.

Types

This section is empty.

Jump to

Keyboard shortcuts

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