labels

package
v1.31.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Truncated         = "truncated"
	TruncationFailure = "truncation_failed"
	OtherError        = "other_error"
)

Variables

View Source
var (
	ErrLabelTruncated        = errors.New("label is truncated")
	ErrLabelTruncationFailed = errors.New("failed to truncate label")
)

Functions

func GetPodLabelMapSize

func GetPodLabelMapSize(podLabelMap PodLabelMap) int

PodLabelMapSize calculates the size of a podLabelMap.

Types

type EndpointPodLabelMap

type EndpointPodLabelMap map[negtypes.NetworkEndpoint]PodLabelMap

EndpointPodLabelMap is a map of network endpoint, endpoint annotations.

type Label

type Label struct {
	Key               string
	ShortKey          string
	MaxLabelSizeBytes int
}

Label contains configuration for a label to be propagated to GCE network endpoints.

type PodLabelMap

type PodLabelMap map[string]string

PodLabelMap is a map of pod label key, label values.

func GetPodLabelMap

func GetPodLabelMap(pod *v1.Pod, lpConfig PodLabelPropagationConfig) (PodLabelMap, error)

GetPodLabelMap will return the label map extracted from a pod according to PodLabelPropagationConfig. The returned map has the pod label key as key and label value as value. This function will raise an error if pod label truncation happens or truncation fails.

type PodLabelPropagationConfig

type PodLabelPropagationConfig struct {
	Labels []Label
}

PodLabelPropagationConfig contains a list of configurations for labels to be propagated to GCE network endpoints.

Jump to

Keyboard shortcuts

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