mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-25 04:11:46 +00:00
test, e2e: Remove duplication when using PodClient.CreateSync
The CreateSync method includes the waiting for the pod to become running and returns a fresh new pod instance. In addition, errors are asserted in the method. Therefore, there is no need for the callers to repeat these operations. Some, like the error assertions, will never be reached in case they occur as they will explode from within the method itself. Signed-off-by: Edward Haas <edwardh@redhat.com>
This commit is contained in:
@@ -171,7 +171,7 @@ var _ = framework.KubeDescribe("NodeProblemDetector [NodeFeature:NodeProblemDete
|
||||
ginkgo.By("Create the node problem detector")
|
||||
hostPathType := new(v1.HostPathType)
|
||||
*hostPathType = v1.HostPathType(string(v1.HostPathFileOrCreate))
|
||||
f.PodClient().CreateSync(&v1.Pod{
|
||||
pod := f.PodClient().CreateSync(&v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: name,
|
||||
},
|
||||
@@ -237,8 +237,6 @@ var _ = framework.KubeDescribe("NodeProblemDetector [NodeFeature:NodeProblemDete
|
||||
},
|
||||
},
|
||||
})
|
||||
pod, err := f.PodClient().Get(context.TODO(), name, metav1.GetOptions{})
|
||||
framework.ExpectNoError(err)
|
||||
// TODO: remove hardcoded kubelet volume directory path
|
||||
// framework.TestContext.KubeVolumeDir is currently not populated for node e2e
|
||||
hostLogFile = "/var/lib/kubelet/pods/" + string(pod.UID) + "/volumes/kubernetes.io~empty-dir" + logFile
|
||||
|
Reference in New Issue
Block a user