kubernetes: k8s.io/kubernetes/pkg/util/labels Index | Files

package labels

import "k8s.io/kubernetes/pkg/util/labels"

Package labels provides utilities to work with Kubernetes labels.

Index

Package Files

doc.go labels.go

func AddLabel Uses

func AddLabel(labels map[string]string, labelKey, labelValue string) map[string]string

AddLabel returns a map with the given key and value added to the given map.

func AddLabelToSelector Uses

func AddLabelToSelector(selector *metav1.LabelSelector, labelKey, labelValue string) *metav1.LabelSelector

AddLabelToSelector returns a selector with the given key and value added to the given selector's MatchLabels.

func CloneAndAddLabel Uses

func CloneAndAddLabel(labels map[string]string, labelKey, labelValue string) map[string]string

Clones the given map and returns a new map with the given key and value added. Returns the given map, if labelKey is empty.

func CloneAndRemoveLabel Uses

func CloneAndRemoveLabel(labels map[string]string, labelKey string) map[string]string

CloneAndRemoveLabel clones the given map and returns a new map with the given key removed. Returns the given map, if labelKey is empty.

func CloneSelectorAndAddLabel Uses

func CloneSelectorAndAddLabel(selector *metav1.LabelSelector, labelKey, labelValue string) *metav1.LabelSelector

Clones the given selector and returns a new selector with the given key and value added. Returns the given selector, if labelKey is empty.

func SelectorHasLabel Uses

func SelectorHasLabel(selector *metav1.LabelSelector, labelKey string) bool

SelectorHasLabel checks if the given selector contains the given label key in its MatchLabels

Package labels imports 1 packages (graph) and is imported by 340 packages. Updated 2018-06-26. Refresh now. Tools for package owners.