mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-14 20:56:42 +00:00
test/e2e: no pod restart policy of nfd-worker by default
Fixes stricter API check on daemonset pod spec that started to cause e2e test failures. RestartPolicyNever that we previously set (by defaylt) isn't compatible with DaemonSets.
This commit is contained in:
parent
fbce8d7702
commit
42ae216284
2 changed files with 8 additions and 3 deletions
|
@ -158,6 +158,7 @@ var _ = SIGDescribe("Node Feature Discovery", func() {
|
|||
// Launch nfd-worker
|
||||
By("Creating a nfd worker pod")
|
||||
podSpecOpts := []testpod.SpecOption{
|
||||
testpod.SpecWithRestartPolicy(corev1.RestartPolicyNever),
|
||||
testpod.SpecWithContainerImage(fmt.Sprintf("%s:%s", *dockerRepo, *dockerTag)),
|
||||
testpod.SpecWithContainerExtraArgs("-oneshot", "-label-sources=fake"),
|
||||
}
|
||||
|
|
|
@ -174,12 +174,16 @@ func NFDWorker(opts ...SpecOption) *corev1.Pod {
|
|||
},
|
||||
Spec: *nfdWorkerSpec(opts...),
|
||||
}
|
||||
|
||||
p.Spec.RestartPolicy = corev1.RestartPolicyNever
|
||||
|
||||
return p
|
||||
}
|
||||
|
||||
// SpecWithRestartPolicy returns a SpecOption that sets the pod restart policy
|
||||
func SpecWithRestartPolicy(restartpolicy corev1.RestartPolicy) SpecOption {
|
||||
return func(spec *corev1.PodSpec) {
|
||||
spec.RestartPolicy = restartpolicy
|
||||
}
|
||||
}
|
||||
|
||||
// SpecWithContainerImage returns a SpecOption that sets the image used by the first container.
|
||||
func SpecWithContainerImage(image string) SpecOption {
|
||||
return func(spec *corev1.PodSpec) {
|
||||
|
|
Loading…
Add table
Reference in a new issue