package labels
import "k8s.io/client-go/pkg/util/labels"
Package labels provides utilities to work with Kubernetes labels.
Index ¶
- func AddLabel(labels map[string]string, labelKey string, labelValue string) map[string]string
- func AddLabelToSelector(selector *unversioned.LabelSelector, labelKey string, labelValue string) *unversioned.LabelSelector
- func CloneAndAddLabel(labels map[string]string, labelKey string, labelValue uint32) map[string]string
- func CloneAndRemoveLabel(labels map[string]string, labelKey string) map[string]string
- func CloneSelectorAndAddLabel(selector *unversioned.LabelSelector, labelKey string, labelValue uint32) *unversioned.LabelSelector
- func SelectorHasLabel(selector *unversioned.LabelSelector, labelKey string) bool
Functions ¶
func AddLabel ¶
AddLabel returns a map with the given key and value added to the given map.
func AddLabelToSelector ¶
func AddLabelToSelector(selector *unversioned.LabelSelector, labelKey string, labelValue string) *unversioned.LabelSelector
AddLabelToSelector returns a selector with the given key and value added to the given selector's MatchLabels.
func CloneAndAddLabel ¶
func CloneAndAddLabel(labels map[string]string, labelKey string, labelValue uint32) 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 ¶
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 ¶
func CloneSelectorAndAddLabel(selector *unversioned.LabelSelector, labelKey string, labelValue uint32) *unversioned.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 ¶
func SelectorHasLabel(selector *unversioned.LabelSelector, labelKey string) bool
SelectorHasLabel checks if the given selector contains the given label key in its MatchLabels
Source Files ¶
doc.go labels.go
- Version
- v2.0.0+incompatible
- Published
- Feb 13, 2017
- Platform
- js/wasm
- Imports
- 2 packages
- Last checked
- 1 minute ago –
Tools for package owners.