label

package
v0.0.0-...-6c4e8d0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ManagedByLabelKey is Kubernetes recommended label key, it represents the tool being used to manage the operation of an application
	// For resources managed by OneCloud Operator, its value is always onecloud-operator
	ManagedByLabelKey string = constants.ManagedByLabelKey
	// ComponentLabelKey is Kubernetes recommended label key, it represents the component within the architecture
	ComponentLabelKey string = constants.ComponentLabelKey
	// NameLabelKey is Kubernetes recommended label key, it represents the name of the application
	// It should always be onecloud-cluster in our case.
	NameLabelKey string = constants.NameLabelKey
	// InstanceLabelKey is Kubernetes recommended label key, it represents a unique name identifying the instance of an application
	// It's set by helm when installing a release
	InstanceLabelKey string = constants.InstanceLabelKey
	AppLabelKey      string = constants.AppLabelKey
	ZoneLabelKey     string = constants.ZoneLabelKey
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Label

type Label map[string]string

Label is the label field in metadata

func New

func New() Label

New initialize a new Label

func (Label) Component

func (l Label) Component(name string) Label

Component adds component kv pair to label

func (Label) ComponentType

func (l Label) ComponentType() string

ComponentType returns component type

func (Label) Instance

func (l Label) Instance(name string) Label

Instance adds instance kv pair to label

func (Label) LabelSelector

func (l Label) LabelSelector() *metav1.LabelSelector

LabelSelector gets LabelSelector from label

func (Label) Labels

func (l Label) Labels() map[string]string

Labels converts label to map[string]string

func (Label) Selector

func (l Label) Selector() (labels.Selector, error)

Selector gets labels.Selector from label

func (Label) String

func (l Label) String() string

String converts label to a string

func (Label) Zone

func (l Label) Zone(zone string) Label

Zone adds zone kvm pair to lable

Jump to

Keyboard shortcuts

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