@@ -21,24 +21,27 @@ import (
21
21
22
22
"github.com/samber/lo"
23
23
"go.uber.org/multierr"
24
- v1 "k8s.io/api/core/v1"
24
+ corev1 "k8s.io/api/core/v1"
25
25
cloudproviderapi "k8s.io/cloud-provider/api"
26
+
27
+ v1 "sigs.k8s.io/karpenter/pkg/apis/v1"
26
28
)
27
29
28
30
// KnownEphemeralTaints are taints that are expected to be added to a node while it's initializing
29
31
// If the node is a Karpenter-managed node, we don't consider these taints while the node is uninitialized
30
32
// since we expect these taints to eventually be removed
31
- var KnownEphemeralTaints = []v1.Taint {
32
- {Key : v1 .TaintNodeNotReady , Effect : v1 .TaintEffectNoSchedule },
33
- {Key : v1 .TaintNodeUnreachable , Effect : v1 .TaintEffectNoSchedule },
34
- {Key : cloudproviderapi .TaintExternalCloudProvider , Effect : v1 .TaintEffectNoSchedule , Value : "true" },
33
+ var KnownEphemeralTaints = []corev1.Taint {
34
+ {Key : corev1 .TaintNodeNotReady , Effect : corev1 .TaintEffectNoSchedule },
35
+ {Key : corev1 .TaintNodeUnreachable , Effect : corev1 .TaintEffectNoSchedule },
36
+ {Key : cloudproviderapi .TaintExternalCloudProvider , Effect : corev1 .TaintEffectNoSchedule , Value : "true" },
37
+ v1 .UnregisteredNoExecuteTaint ,
35
38
}
36
39
37
- // Taints is a decorated alias type for []v1 .Taint
38
- type Taints []v1 .Taint
40
+ // Taints is a decorated alias type for []corev1 .Taint
41
+ type Taints []corev1 .Taint
39
42
40
43
// Tolerates returns true if the pod tolerates all taints.
41
- func (ts Taints ) Tolerates (pod * v1 .Pod ) (errs error ) {
44
+ func (ts Taints ) Tolerates (pod * corev1 .Pod ) (errs error ) {
42
45
for i := range ts {
43
46
taint := ts [i ]
44
47
tolerates := false
@@ -54,11 +57,11 @@ func (ts Taints) Tolerates(pod *v1.Pod) (errs error) {
54
57
55
58
// Merge merges in taints with the passed in taints.
56
59
func (ts Taints ) Merge (with Taints ) Taints {
57
- res := lo .Map (ts , func (t v1 .Taint , _ int ) v1 .Taint {
60
+ res := lo .Map (ts , func (t corev1 .Taint , _ int ) corev1 .Taint {
58
61
return t
59
62
})
60
63
for _ , taint := range with {
61
- if _ , ok := lo .Find (res , func (t v1 .Taint ) bool {
64
+ if _ , ok := lo .Find (res , func (t corev1 .Taint ) bool {
62
65
return taint .MatchTaint (& t )
63
66
}); ! ok {
64
67
res = append (res , taint )
0 commit comments