mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
Merge pull request #128809 from bitoku/pod-test
Change way to create a pod in test
This commit is contained in:
commit
46708fa09e
@ -851,7 +851,7 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
ginkgo.By("Create set of pods")
|
ginkgo.By("Create set of pods")
|
||||||
// create a set of pods in test namespace
|
// create a set of pods in test namespace
|
||||||
for _, podTestName := range podTestNames {
|
for _, podTestName := range podTestNames {
|
||||||
_, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(ctx,
|
_ = podClient.Create(ctx,
|
||||||
e2epod.MustMixinRestrictedPodSecurity(&v1.Pod{
|
e2epod.MustMixinRestrictedPodSecurity(&v1.Pod{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: podTestName,
|
Name: podTestName,
|
||||||
@ -866,8 +866,7 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
Name: "token-test",
|
Name: "token-test",
|
||||||
}},
|
}},
|
||||||
RestartPolicy: v1.RestartPolicyNever,
|
RestartPolicy: v1.RestartPolicyNever,
|
||||||
}}), metav1.CreateOptions{})
|
}}))
|
||||||
framework.ExpectNoError(err, "failed to create pod")
|
|
||||||
framework.Logf("created %v", podTestName)
|
framework.Logf("created %v", podTestName)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -929,8 +928,7 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
ginkgo.By("creating a Pod with a static label")
|
ginkgo.By("creating a Pod with a static label")
|
||||||
_, err = f.ClientSet.CoreV1().Pods(testNamespaceName).Create(ctx, testPod, metav1.CreateOptions{})
|
_ = podClient.Create(ctx, testPod)
|
||||||
framework.ExpectNoError(err, "failed to create Pod %v in namespace %v", testPod.ObjectMeta.Name, testNamespaceName)
|
|
||||||
|
|
||||||
ginkgo.By("watching for Pod to be ready")
|
ginkgo.By("watching for Pod to be ready")
|
||||||
ctxUntil, cancel := context.WithTimeout(ctx, f.Timeouts.PodStart)
|
ctxUntil, cancel := context.WithTimeout(ctx, f.Timeouts.PodStart)
|
||||||
@ -1082,8 +1080,6 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
the fields MUST equal the new values.
|
the fields MUST equal the new values.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should patch a pod status", func(ctx context.Context) {
|
framework.ConformanceIt("should patch a pod status", func(ctx context.Context) {
|
||||||
ns := f.Namespace.Name
|
|
||||||
podClient := f.ClientSet.CoreV1().Pods(ns)
|
|
||||||
podName := "pod-" + utilrand.String(5)
|
podName := "pod-" + utilrand.String(5)
|
||||||
label := map[string]string{"e2e": podName}
|
label := map[string]string{"e2e": podName}
|
||||||
|
|
||||||
@ -1103,8 +1099,7 @@ var _ = SIGDescribe("Pods", func() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
pod, err := podClient.Create(ctx, testPod, metav1.CreateOptions{})
|
pod := podClient.Create(ctx, testPod)
|
||||||
framework.ExpectNoError(err, "failed to create Pod %v in namespace %v", testPod.ObjectMeta.Name, ns)
|
|
||||||
framework.ExpectNoError(e2epod.WaitForPodRunningInNamespace(ctx, f.ClientSet, pod), "Pod didn't start within time out period")
|
framework.ExpectNoError(e2epod.WaitForPodRunningInNamespace(ctx, f.ClientSet, pod), "Pod didn't start within time out period")
|
||||||
|
|
||||||
ginkgo.By("patching /status")
|
ginkgo.By("patching /status")
|
||||||
|
Loading…
Reference in New Issue
Block a user