labels

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package labels provides shared Kubernetes recommended label constants and builder functions for all operator-managed resources.

See: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/

Index

Constants

View Source
const (
	// Name identifies the application name (Kubernetes Recommended Label).
	Name = "app.kubernetes.io/name"

	// Component identifies the component within the architecture (e.g. "module", "workspace").
	Component = "app.kubernetes.io/component"

	// PartOf identifies the higher-level application this resource belongs to.
	PartOf = "app.kubernetes.io/part-of"

	// ManagedBy identifies the tool/operator that manages the resource.
	ManagedBy = "app.kubernetes.io/managed-by"

	// Version identifies the current version of the application.
	Version = "app.kubernetes.io/version"

	// System is the fixed PartOf value shared across all OtterScale operators.
	System = "otterscale-system"

	// Operator is the ManagedBy value for this operator.
	Operator = "model-operator"
)

Variables

This section is empty.

Functions

func Selector added in v0.8.1

func Selector(name, component string) map[string]string

Selector returns the minimal label set used for MatchingLabels queries. It deliberately excludes Version so that operator upgrades do not break resource lookups for in-flight Jobs created by a previous version.

func Standard

func Standard(name, component, version string) map[string]string

Standard returns the full set of Kubernetes recommended labels for all operator-managed resources. Use this when creating or labelling resources. Use Selector() when querying resources via MatchingLabels.

If version is empty, the app.kubernetes.io/version label is omitted, as an empty version label carries no semantic meaning per K8s conventions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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