labels

package
v0.0.0-...-4c0bbbd Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8SLabelKey

type K8SLabelKey string

K8SlabelKey is the commonly used labels as kubernetes docs defines. https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/

var (
	// NameLabelKey is the name of the application.
	NameLabelKey K8SLabelKey = "app.kubernetes.io/name"

	// InstanceLabelKey is a unique name identifying the instance of an application.
	InstanceLabelKey K8SLabelKey = "app.kubernetes.io/instance"

	// ManagedByLabelKey represents the tool being used to manage the operation of an application.
	ManagedByLabelKey K8SLabelKey = "app.kubernetes.io/managed-by"

	// ComponentLabelKey is the component within the architecture
	ComponentLabelKey K8SLabelKey = "app.kubernetes.io/component"
)

type Labels

type Labels map[string]string

Labels is the standard type to manage labels for the operator.

func NewLabelSet

func NewLabelSet() Labels

NewLabels returns a new Labels type to which type can be associated.

func (Labels) AsK8sLabelSelector

func (l Labels) AsK8sLabelSelector() *metav1.LabelSelector

AsK8sLabelSelector returns label selector from Label set type.

func (Labels) Component

func (l Labels) Component(value string) Labels

Component sets the ComponentLabelKey in the labels set.

func (Labels) Get

func (l Labels) Get(label string) string

Get returns the value of the requested label.

func (Labels) Has

func (l Labels) Has(label string) bool

Has checks if the provided label is present in the label set.

func (Labels) Instance

func (l Labels) Instance(value string) Labels

Instance sets the InstanceLabelKey in the lables set.

func (Labels) ManagedBy

func (l Labels) ManagedBy(value string) Labels

ManagedBy sets the ManagedByLabelKey in the labels set.

func (Labels) Name

func (l Labels) Name(value string) Labels

Name sets the NameLabelKey in the label set.

func (Labels) Set

func (l Labels) Set(label, value string)

Set a label value in the label set

func (Labels) String

func (l Labels) String() string

String returns all labels listed as a human readable string.

Jump to

Keyboard shortcuts

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