Documentation ¶
Overview ¶
Package pod contains utilities to deal with Pod objects.
Index ¶
- func AreContainersEqual(previous, updated []corev1.Container) bool
- func CheckShadowPodUpdate(previous, updated *corev1.PodSpec) bool
- func ForgeContainerResources(cpuRequests, cpuLimits, ramRequests, ramLimits resource.Quantity) corev1.ResourceRequirements
- func GetPodCondition(status *corev1.PodStatus, conditionType corev1.PodConditionType) *corev1.PodCondition
- func IsPodReady(pod *corev1.Pod) (ready bool, reason string)
- func IsPodSpecEqual(previous, updated *corev1.PodSpec) bool
- func ServiceAccountName(pod *corev1.Pod) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AreContainersEqual ¶ added in v0.3.2
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
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 ¶
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
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
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.