pod

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package pod contains utilities to deal with Pod objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreContainersEqual added in v0.3.2

func AreContainersEqual(previous, updated []corev1.Container) bool

AreContainersEqual returns whether two container lists are equal according to the fields that can be modified after start-up time (i.e. the image field).

func CheckShadowPodUpdate added in v0.6.0

func CheckShadowPodUpdate(previous, updated *corev1.PodSpec) bool

CheckShadowPodUpdate returns whether updated equals previous, except for the fields that are allowed to be updated. The updated object gets mutated, and a deepcopy shall be performed if it needs to be reused.

func ForgeContainerResources added in v0.6.0

func ForgeContainerResources(cpuRequests, cpuLimits, ramRequests, ramLimits resource.Quantity) corev1.ResourceRequirements

ForgeContainerResources forges the container resource requirements, leaving unset the ones not specified.

func GetPodCondition added in v0.9.0

func GetPodCondition(status *corev1.PodStatus, conditionType corev1.PodConditionType) *corev1.PodCondition

GetPodCondition extracts the provided condition from the given status and returns that.

func IsPodReady

func IsPodReady(pod *corev1.Pod) (ready bool, reason string)

IsPodReady returns true if a pod is ready; false otherwise. It also returns a reason (as provided by Kubernetes).

func IsPodSpecEqual added in v0.3.2

func IsPodSpecEqual(previous, updated *corev1.PodSpec) bool

IsPodSpecEqual returns whether two pod specs are equal according to the fields that can be modified after start-up time. Refer to the following link for more information: https://kubernetes.io/docs/concepts/workloads/pods/#pod-update-and-replacement This function is implemented custom instead of relying on reflect.DeepEqual or alike for performance reasons, given the possibly high execution rate when dealing with pod reflection.

func ServiceAccountName added in v0.6.0

func ServiceAccountName(pod *corev1.Pod) string

ServiceAccountName returns the name of the service account, or default if not set. Indeed, the ServiceAccountName field in the pod specifications is optional, and empty means default.

Types

This section is empty.

Jump to

Keyboard shortcuts

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