1
0
Fork 0
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:
Kubernetes Prow Robot 2022-12-02 00:37:54 -08:00 committed by GitHub
commit 1accbbf337
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -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"),
}

View file

@ -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) {