meta

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package meta defines shared metadata keys and naming rules used across Cocoon controllers, webhooks, dashboards, and providers.

Index

Constants

View Source
const (
	APIVersion    = "cocoon.cis/v1alpha1"
	KindCocoonSet = "CocoonSet"

	TolerationKey = "virtual-kubelet.io/provider"

	LabelCocoonSet = "cocoon.cis/cocoonset"
	LabelRole      = "cocoon.cis/role"
	LabelSlot      = "cocoon.cis/slot"

	AnnotationMode           = "cocoon.cis/mode"
	AnnotationImage          = "cocoon.cis/image"
	AnnotationStorage        = "cocoon.cis/storage"
	AnnotationManaged        = "cocoon.cis/managed"
	AnnotationOS             = "cocoon.cis/os"
	AnnotationForkFrom       = "cocoon.cis/fork-from"
	AnnotationSnapshotPolicy = "cocoon.cis/snapshot-policy"
	AnnotationIP             = "cocoon.cis/ip"
	AnnotationVMID           = "cocoon.cis/vm-id"
	AnnotationVMName         = "cocoon.cis/vm-name"
	AnnotationVNCPort        = "cocoon.cis/vnc-port"
	AnnotationHibernate      = "cocoon.cis/hibernate"

	RoleMain     = "main"
	RoleSubAgent = "sub-agent"
	RoleToolbox  = "toolbox"
)

Variables

This section is empty.

Functions

func ConnectionType

func ConnectionType(osType string, hasVNCPort bool) string

ConnectionType returns the preferred connection protocol for the given OS and VNC availability.

func ExtractSlotFromVMName

func ExtractSlotFromVMName(vmName string) int

ExtractSlotFromVMName parses the trailing slot index from a VM name, returning -1 if absent.

func HasCocoonToleration

func HasCocoonToleration(tolerations []corev1.Toleration) bool

HasCocoonToleration reports whether any toleration matches the virtual-kubelet provider key.

func InferRoleFromVMName

func InferRoleFromVMName(vmName string) string

InferRoleFromVMName determines the role (main or sub-agent) based on the VM name slot.

func MainAgentVMName

func MainAgentVMName(vmName string) string

MainAgentVMName replaces the slot suffix with 0 to derive the main agent name.

func OwnerDeploymentName added in v0.1.2

func OwnerDeploymentName(ownerRefs []metav1.OwnerReference) string

OwnerDeploymentName extracts the deployment name from a ReplicaSet owner reference.

func VMNameForDeployment

func VMNameForDeployment(namespace, deployment string, slot int) string

VMNameForDeployment builds a deterministic VM name for a deployment slot.

func VMNameForPod

func VMNameForPod(namespace, podName string) string

VMNameForPod builds a deterministic VM name for a standalone pod.

Types

This section is empty.

Jump to

Keyboard shortcuts

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