mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-15 14:53:44 +00:00
Fix label patch and check
This commit is contained in:
parent
05163497bc
commit
bd34e1c445
@ -922,7 +922,7 @@ var _ = framework.KubeDescribe("Pods", func() {
|
|||||||
ginkgo.By("patching the Pod with a new Label and updated data")
|
ginkgo.By("patching the Pod with a new Label and updated data")
|
||||||
podPatch, err := json.Marshal(v1.Pod{
|
podPatch, err := json.Marshal(v1.Pod{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Labels: map[string]string{"podtemplate": "patched"},
|
Labels: map[string]string{"test-pod": "patched"},
|
||||||
},
|
},
|
||||||
Spec: v1.PodSpec{
|
Spec: v1.PodSpec{
|
||||||
Containers: []v1.Container{{
|
Containers: []v1.Container{{
|
||||||
@ -938,7 +938,7 @@ var _ = framework.KubeDescribe("Pods", func() {
|
|||||||
ginkgo.By("getting the Pod and ensuring that it's patched")
|
ginkgo.By("getting the Pod and ensuring that it's patched")
|
||||||
pod, err := f.ClientSet.CoreV1().Pods(testNs).Get(context.TODO(), testPodName, metav1.GetOptions{})
|
pod, err := f.ClientSet.CoreV1().Pods(testNs).Get(context.TODO(), testPodName, metav1.GetOptions{})
|
||||||
framework.ExpectNoError(err, "failed to fetch Pod %s in namespace %s", testPodName, testNs)
|
framework.ExpectNoError(err, "failed to fetch Pod %s in namespace %s", testPodName, testNs)
|
||||||
framework.ExpectEqual(pod.ObjectMeta.Labels["test-pod-static"], "true", "failed to patch Pod - missing label")
|
framework.ExpectEqual(pod.ObjectMeta.Labels["test-pod"], "patched", "failed to patch Pod - missing label")
|
||||||
framework.ExpectEqual(pod.Spec.Containers[0].Image, testPodImage2, "failed to patch Pod - wrong image")
|
framework.ExpectEqual(pod.Spec.Containers[0].Image, testPodImage2, "failed to patch Pod - wrong image")
|
||||||
|
|
||||||
ginkgo.By("getting the PodStatus")
|
ginkgo.By("getting the PodStatus")
|
||||||
|
Loading…
Reference in New Issue
Block a user