...
1
16
17 package types
18
19 import (
20 v1 "k8s.io/api/core/v1"
21 utilfeature "k8s.io/apiserver/pkg/util/feature"
22 "k8s.io/kubernetes/pkg/features"
23 )
24
25
26 var PodConditionsByKubelet = []v1.PodConditionType{
27 v1.PodScheduled,
28 v1.PodReady,
29 v1.PodInitialized,
30 v1.ContainersReady,
31 }
32
33
34 func PodConditionByKubelet(conditionType v1.PodConditionType) bool {
35 for _, c := range PodConditionsByKubelet {
36 if c == conditionType {
37 return true
38 }
39 }
40 if utilfeature.DefaultFeatureGate.Enabled(features.PodReadyToStartContainersCondition) {
41 if conditionType == v1.PodReadyToStartContainers {
42 return true
43 }
44 }
45 return false
46 }
47
48
49 func PodConditionSharedByKubelet(conditionType v1.PodConditionType) bool {
50 if utilfeature.DefaultFeatureGate.Enabled(features.PodDisruptionConditions) {
51 if conditionType == v1.DisruptionTarget {
52 return true
53 }
54 }
55 return false
56 }
57
View as plain text