Documentation
¶
Overview ¶
Package meta defines shared metadata keys and naming rules used across Cocoon controllers, webhooks, dashboards, and providers.
Index ¶
- Constants
- func ConnectionType(osType string, hasVNCPort bool) string
- func ExtractSlotFromVMName(vmName string) int
- func HasCocoonToleration(tolerations []corev1.Toleration) bool
- func InferRoleFromVMName(vmName string) string
- func MainAgentVMName(vmName string) string
- func OwnerDeploymentName(ownerRefs []metav1.OwnerReference) string
- func VMNameForDeployment(namespace, deployment string, slot int) string
- func VMNameForPod(namespace, podName string) string
Constants ¶
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 ¶
ConnectionType returns the preferred connection protocol for the given OS and VNC availability.
func ExtractSlotFromVMName ¶
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 ¶
InferRoleFromVMName determines the role (main or sub-agent) based on the VM name slot.
func MainAgentVMName ¶
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 ¶
VMNameForDeployment builds a deterministic VM name for a deployment slot.
func VMNameForPod ¶
VMNameForPod builds a deterministic VM name for a standalone pod.
Types ¶
This section is empty.