models

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pod

type Pod struct {
	corev1.Pod
	// contains filtered or unexported fields
}

func NewPod

func NewPod(pod *corev1.Pod, ctx context.Context, recorder record.EventRecorder) *Pod

func (*Pod) AddGate

func (pod *Pod) AddGate(gateName string)

AddGate adds a scheduling gate to the pod if it does not already exist.

func (*Pod) ContainerNameFor

func (pod *Pod) ContainerNameFor(containerID string) (string, error)

func (*Pod) Ctx

func (pod *Pod) Ctx() context.Context

Ctx returns the context associated with the Pod.

func (*Pod) EnsureAndIncrementLabel

func (pod *Pod) EnsureAndIncrementLabel(label string)

EnsureAndIncrementLabel ensures that the pod has the given label with the given value. If the label is already set, it increments the value.

func (*Pod) EnsureAnnotation

func (pod *Pod) EnsureAnnotation(annotation string, value string)

EnsureAnnotation ensures that the pod has the given annotation with the given value.

func (*Pod) EnsureLabel

func (pod *Pod) EnsureLabel(label string, value string)

EnsureLabel ensures that the pod has the given label with the given value.

func (*Pod) EnsureNoLabel

func (pod *Pod) EnsureNoLabel(label string)

EnsureNoLabel ensures that the pod does not have the given label.

func (*Pod) HasControlPlaneNodeSelector

func (pod *Pod) HasControlPlaneNodeSelector() bool

HasControlPlaneNodeSelector returns true if the pod has a node selector that matches the control plane nodes.

func (*Pod) HasGate

func (pod *Pod) HasGate(gateName string) bool

HasGate checks if the pod has a specific scheduling gate.

func (*Pod) IsFromDaemonSet

func (pod *Pod) IsFromDaemonSet() bool

IsFromDaemonSet returns true if the pod is from a daemonSet.

func (*Pod) PodObject

func (pod *Pod) PodObject() *corev1.Pod

func (*Pod) PublishEvent

func (pod *Pod) PublishEvent(eventType, reason, message string)

PublishEvent publishes an event for the pod using the EventRecorder.

func (*Pod) Recorder

func (pod *Pod) Recorder() record.EventRecorder

Recorder returns the EventRecorder associated with the Pod.

func (*Pod) RemoveGate

func (pod *Pod) RemoveGate(gateName string)

RemoveGate removes a scheduling gate from the pod if it exists.

Jump to

Keyboard shortcuts

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