Skip to content

Commit

Permalink
Remove the secure boot checker pod
Browse files Browse the repository at this point in the history
This commit removes the pod that is created to validate if the node has
secure boot enable or not

Before this PR after every test running there are test pods in the sriov
operator namespace that does not get clean

Signed-off-by: Sebastian Sch <[email protected]>
  • Loading branch information
SchSeba committed Jan 20, 2022
1 parent f4cc0f3 commit e835e8f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/util/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"io"
"k8s.io/utils/pointer"
"strings"
"time"

Expand Down Expand Up @@ -282,6 +283,13 @@ func GetNodeSecureBootState(clients *testclient.ClientSet, nodeName, namespace s
return false, err
}

defer func() {
err = clients.Pods(namespace).Delete(context.Background(), created.Name, metav1.DeleteOptions{GracePeriodSeconds: pointer.Int64Ptr(0)})
if err != nil {
err = fmt.Errorf("failed to remove the check secure boot status pod for node %s: %v", nodeName, err)
}
}()

var runningPod *corev1.Pod
err = wait.PollImmediate(time.Second, 3*time.Minute, func() (bool, error) {
runningPod, err = clients.Pods(namespace).Get(context.Background(), created.Name, metav1.GetOptions{})
Expand Down

0 comments on commit e835e8f

Please sign in to comment.