kubernetesk8s.io/kubernetes/pkg/api/pod Index | Files

package pod

import "k8s.io/kubernetes/pkg/api/pod"

Index

Functions

func DropDisabledAlphaFields

func DropDisabledAlphaFields(podSpec *api.PodSpec)

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

func DropDisabledProcMountField

func DropDisabledProcMountField(podSpec *api.PodSpec)

DropDisabledProcMountField removes disabled fields from PodSpec related to ProcMount

func DropDisabledRunAsGroupField

func DropDisabledRunAsGroupField(podSpec *api.PodSpec)

DropDisabledRunAsGroupField removes disabled fields from PodSpec related to RunAsGroup

func DropDisabledVolumeDevicesAlphaFields

func DropDisabledVolumeDevicesAlphaFields(podSpec *api.PodSpec)

DropDisabledVolumeDevicesAlphaFields removes disabled fields from []VolumeDevice. This should be called from PrepareForCreate/PrepareForUpdate for all resources containing a VolumeDevice

func GetPodCondition

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

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

func IsPodReady(pod *api.Pod) bool

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

func IsPodReadyConditionTrue

func IsPodReadyConditionTrue(status api.PodStatus) bool

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

func UpdatePodCondition

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 VisitPodConfigmapNames

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

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 Visitor

type Visitor func(name string) (shouldContinue bool)

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

Source Files

util.go

Version
v1.13.8
Published
Jul 4, 2019
Platform
js/wasm
Imports
4 packages
Last checked
52 seconds ago

Tools for package owners.