Documentation ¶
Index ¶
- func DropDisabledPodFields(pod, oldPod *api.Pod)
- func DropDisabledTemplateFields(podTemplate, oldPodTemplate *api.PodTemplateSpec)
- func GetPodCondition(status *api.PodStatus, conditionType api.PodConditionType) (int, *api.PodCondition)
- func GetPodReadyCondition(status api.PodStatus) *api.PodCondition
- func GetValidationOptionsFromPodSpecAndMeta(podSpec, oldPodSpec *api.PodSpec, podMeta, oldPodMeta *metav1.ObjectMeta) apivalidation.PodValidationOptions
- func GetValidationOptionsFromPodTemplate(podTemplate, oldPodTemplate *api.PodTemplateSpec) apivalidation.PodValidationOptions
- func GetWarningsForPod(ctx context.Context, pod, oldPod *api.Pod) []string
- func GetWarningsForPodTemplate(ctx context.Context, fieldPath *field.Path, ...) []string
- func IsPodReady(pod *api.Pod) bool
- func IsPodReadyConditionTrue(status api.PodStatus) bool
- func MarkPodProposedForResize(oldPod, newPod *api.Pod)
- func UpdatePodCondition(status *api.PodStatus, condition *api.PodCondition) bool
- func VisitContainers(podSpec *api.PodSpec, mask ContainerType, visitor ContainerVisitor) bool
- func VisitPodConfigmapNames(pod *api.Pod, visitor Visitor, containerType ContainerType) bool
- func VisitPodSecretNames(pod *api.Pod, visitor Visitor, containerType ContainerType) bool
- type ContainerType
- type ContainerVisitor
- type Visitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DropDisabledPodFields ¶ added in v1.14.0
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 GetValidationOptionsFromPodSpecAndMeta ¶ added in v1.21.0
func GetValidationOptionsFromPodSpecAndMeta(podSpec, oldPodSpec *api.PodSpec, podMeta, oldPodMeta *metav1.ObjectMeta) apivalidation.PodValidationOptions
GetValidationOptionsFromPodSpecAndMeta returns validation options based on pod specs and metadata
func GetValidationOptionsFromPodTemplate ¶ added in v1.20.0
func GetValidationOptionsFromPodTemplate(podTemplate, oldPodTemplate *api.PodTemplateSpec) apivalidation.PodValidationOptions
GetValidationOptionsFromPodTemplate will return pod validation options for specified template.
func GetWarningsForPod ¶ added in v1.22.0
func GetWarningsForPodTemplate ¶ added in v1.22.0
func IsPodReady ¶ added in v1.7.0
IsPodReady returns true if a pod is ready; false otherwise.
func IsPodReadyConditionTrue ¶ added in v1.7.0
IsPodReadyConditionTrue returns true if a pod is ready; false otherwise.
func MarkPodProposedForResize ¶ added in v1.27.0
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, mask ContainerType, visitor ContainerVisitor) bool
VisitContainers invokes the visitor function with a pointer to every container spec in the given pod spec with type set in mask. 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, containerType ContainerType) 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, containerType ContainerType) 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 ContainerType ¶ added in v1.18.0
type ContainerType int
ContainerType signifies container type
const ( // Containers is for normal containers Containers ContainerType = 1 << iota // InitContainers is for init containers InitContainers // EphemeralContainers is for ephemeral containers EphemeralContainers )
const AllContainers ContainerType = (InitContainers | Containers | EphemeralContainers)
AllContainers specifies that all containers be visited
func AllFeatureEnabledContainers ¶ added in v1.19.0
func AllFeatureEnabledContainers() ContainerType
AllFeatureEnabledContainers returns a ContainerType mask which includes all container types except for the ones guarded by feature gate.
type ContainerVisitor ¶ added in v1.16.0
type ContainerVisitor func(container *api.Container, containerType ContainerType) (shouldContinue bool)
ContainerVisitor is called with each container spec, and returns true if visiting should continue.