File tree 2 files changed +11
-1
lines changed
pkg/kubelet/apis/config/validation
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ func ValidateKubeletConfiguration(kc *kubeletconfig.KubeletConfiguration) error
133
133
allErrors = append (allErrors , fmt .Errorf ("invalid taint: %v" , nodeTaint ))
134
134
}
135
135
if nodeTaint .TimeAdded != nil {
136
- allErrors = append (allErrors , fmt .Errorf ("taint TimeAdded is not nil" ))
136
+ allErrors = append (allErrors , fmt .Errorf ("invalid configuration: taint. TimeAdded is not nil" ))
137
137
}
138
138
}
139
139
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
21
21
"testing"
22
22
"time"
23
23
24
+ v1 "k8s.io/api/core/v1"
24
25
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
25
26
componentbaseconfig "k8s.io/component-base/config"
26
27
kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
@@ -483,6 +484,15 @@ func TestValidateKubeletConfiguration(t *testing.T) {
483
484
},
484
485
errMsg : "invalid configuration: memoryThrottlingFactor 1.1 must be greater than 0 and less than or equal to 1.0" ,
485
486
},
487
+ {
488
+ name : "invalid Taint.TimeAdded" ,
489
+ configure : func (conf * kubeletconfig.KubeletConfiguration ) * kubeletconfig.KubeletConfiguration {
490
+ now := metav1 .Now ()
491
+ conf .RegisterWithTaints = []v1.Taint {{TimeAdded : & now }}
492
+ return conf
493
+ },
494
+ errMsg : "invalid configuration: taint.TimeAdded is not nil" ,
495
+ },
486
496
}
487
497
488
498
for _ , tc := range cases {
You can’t perform that action at this time.
0 commit comments