Help us shape the future of Go! Take the 2026 Go Developer Survey

labels

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 3 Imported by: 22

Documentation

Index

Constants

View Source
const (
	K8sAppName      = "app.kubernetes.io/name"
	K8sAppInstance  = "app.kubernetes.io/instance"
	K8sAppVersion   = "app.kubernetes.io/version"
	K8sAppComponent = "app.kubernetes.io/component"
	K8sAppPartOf    = "app.kubernetes.io/part-of"
	K8sAppManagedBy = "app.kubernetes.io/managed-by"
	K8sHostname     = "kubernetes.io/hostname"
)

k8s recommended labels from https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/ .

Variables

This section is empty.

Functions

func GetAppLabelSelector added in v0.6.0

func GetAppLabelSelector(
	name string,
) metav1.LabelSelector

GetAppLabelSelector - create a simple label selector for the default AppSelector "service" label

func GetGroupLabel

func GetGroupLabel(serviceName string) string

GetGroupLabel -

func GetLabelSelector added in v0.6.0

func GetLabelSelector(
	serviceLabels map[string]string,
) metav1.LabelSelector

GetLabelSelector - utility function that returns a metav1.LabelSelector based on the map[string]string that represents the k/v list passed to the StatefulSet or Deployment as labelSelector

func GetLabels

func GetLabels(
	obj metav1.Object,
	groupLabel string,
	custom map[string]string,
) map[string]string

GetLabels - create default labels map, additional custom labels can be passed

func GetOwnerNameLabelSelector

func GetOwnerNameLabelSelector(groupLabel string) string

GetOwnerNameLabelSelector -

func GetOwnerNameSpaceLabelSelector

func GetOwnerNameSpaceLabelSelector(groupLabel string) string

GetOwnerNameSpaceLabelSelector -

func GetOwnerUIDLabelSelector

func GetOwnerUIDLabelSelector(groupLabel string) string

GetOwnerUIDLabelSelector -

func GetSingleLabelSelector added in v0.6.0

func GetSingleLabelSelector(
	key string,
	value string,
) metav1.LabelSelector

GetSingleLabelSelector - create a simple label selector for a single key/value label

Types

This section is empty.

Jump to

Keyboard shortcuts

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