pod

package
v1.18.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: Apache-2.0 Imports: 6 Imported by: 514

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropDisabledPodFields added in v1.14.0

func DropDisabledPodFields(pod, oldPod *api.Pod)

DropDisabledPodFields removes disabled fields from the pod metadata and spec. This should be called from PrepareForCreate/PrepareForUpdate for all resources containing a Pod

func DropDisabledTemplateFields added in v1.14.0

func DropDisabledTemplateFields(podTemplate, oldPodTemplate *api.PodTemplateSpec)

DropDisabledTemplateFields removes disabled fields from the pod template metadata and spec. This should be called from PrepareForCreate/PrepareForUpdate for all resources containing a PodTemplateSpec

func GetPodCondition added in v1.7.0

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

GetPodCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.

func GetPodReadyCondition added in v1.7.0

func GetPodReadyCondition(status api.PodStatus) *api.PodCondition

GetPodReadyCondition extracts the pod ready condition from the given status and returns that. Returns nil if the condition is not present.

func IsPodReady added in v1.7.0

func IsPodReady(pod *api.Pod) bool

IsPodReady returns true if a pod is ready; false otherwise.

func IsPodReadyConditionTrue added in v1.7.0

func IsPodReadyConditionTrue(status api.PodStatus) bool

IsPodReadyConditionTrue returns true if a pod is ready; false otherwise.

func UpdatePodCondition added in v1.7.0

func UpdatePodCondition(status *api.PodStatus, condition *api.PodCondition) bool

UpdatePodCondition updates existing pod condition or creates a new one. Sets LastTransitionTime to now if the status has changed. Returns true if pod condition has changed or has been added.

func VisitContainers added in v1.16.0

func VisitContainers(podSpec *api.PodSpec, visitor ContainerVisitor) bool

VisitContainers invokes the visitor function with a pointer to the container spec of every container in the given pod spec. If visitor returns false, visiting is short-circuited. VisitContainers returns true if visiting completes, false if visiting was short-circuited.

func VisitPodConfigmapNames added in v1.7.0

func VisitPodConfigmapNames(pod *api.Pod, visitor Visitor) bool

VisitPodConfigmapNames invokes the visitor function with the name of every configmap referenced by the pod spec. If visitor returns false, visiting is short-circuited. Transitive references (e.g. pod -> pvc -> pv -> secret) are not visited. Returns true if visiting completed, false if visiting was short-circuited.

func VisitPodSecretNames added in v1.6.0

func VisitPodSecretNames(pod *api.Pod, visitor Visitor) bool

VisitPodSecretNames invokes the visitor function with the name of every secret referenced by the pod spec. If visitor returns false, visiting is short-circuited. Transitive references (e.g. pod -> pvc -> pv -> secret) are not visited. Returns true if visiting completed, false if visiting was short-circuited.

Types

type ContainerVisitor added in v1.16.0

type ContainerVisitor func(container *api.Container) (shouldContinue bool)

ContainerVisitor is called with each container spec, and returns true if visiting should continue.

type Visitor added in v1.7.0

type Visitor func(name string) (shouldContinue bool)

Visitor is called with each object name, and returns true if visiting should continue

Jump to

Keyboard shortcuts

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