Documentation ¶
Index ¶
- Constants
- func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
- func IsContainerInCrashLoopBackOff(containerState v1.ContainerState) bool
- func IsPodAvailable(pod *v1.Pod, minReadySeconds int32, now metav1.Time) bool
- func IsPodDeleted(pod *v1.Pod) bool
- func IsPodInCrashloopBackoff(status v1.PodStatus) bool
- func IsPodReady(pod *v1.Pod) bool
- func IsPodReadyConditionTrue(status v1.PodStatus) bool
- func IsReadyEndpointPresentInSubsets(subsets []v1.EndpointSubset) bool
- func LoadServiceDependants(file string) (*serviceDependants, error)
- func ShouldDeletePod(pod *v1.Pod) bool
- type Controller
Constants ¶
const (
CrashLoopBackOff = "CrashLoopBackOff"
)
Variables ¶
This section is empty.
Functions ¶
func GetPodCondition ¶
func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.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 GetPodConditionFromList ¶
func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)
GetPodConditionFromList extracts the provided condition from the given list of condition and returns the index of the condition and the condition. Returns -1 and nil if the condition is not present.
func GetPodReadyCondition ¶
func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
GetPodReadyCondition extracts the pod ready condition from the given status and returns that. Returns nil if the condition is not present.
func IsContainerInCrashLoopBackOff ¶
func IsContainerInCrashLoopBackOff(containerState v1.ContainerState) bool
func IsPodAvailable ¶
IsPodAvailable returns true if a pod is available; false otherwise. Precondition for an available pod is that it must be ready. On top of that, there are two cases when a pod can be considered available: 1. minReadySeconds == 0, or 2. LastTransitionTime (is set) + minReadySeconds < current time
func IsPodDeleted ¶
IsPodReady returns true if a pod is ready; false otherwise.
func IsPodInCrashloopBackoff ¶
func IsPodReady ¶
IsPodReady returns true if a pod is ready; false otherwise.
func IsPodReadyConditionTrue ¶
IsPodReadyConditionTrue returns true if a pod is ready; false otherwise.
func IsReadyEndpointPresentInSubsets ¶
func IsReadyEndpointPresentInSubsets(subsets []v1.EndpointSubset) bool
func LoadServiceDependants ¶
func ShouldDeletePod ¶
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller looks at ServiceDependants and reconciles the dependantPods once the service becomes available.
func NewController ¶
func NewController(clientset *kubernetes.Clientset, sharedInformerFactory informers.SharedInformerFactory, serviceDependants *serviceDependants, watchDuration time.Duration, stopCh <-chan struct{}) *Controller
func (*Controller) Run ¶
func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error
Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.