mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-15 04:57:56 +00:00
Merge pull request #975 from marquiz/fixes/e2e
test/e2e: no pod restart policy of nfd-worker by default
This commit is contained in:
commit
1accbbf337
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