diff --git a/e2e/drift/drift_test.go b/e2e/drift/drift_test.go index 0de9030e60..2f333aa438 100644 --- a/e2e/drift/drift_test.go +++ b/e2e/drift/drift_test.go @@ -49,7 +49,8 @@ var _ = Describe("Drift", Ordered, func() { JustBeforeEach(func() { kw := k.Namespace(namespace) out, err := kw.Patch( - "service", "nginx-service", + "service", "drift-dummy-service", + "-o=json", "--type=json", "-p", `[{"op": "replace", "path": "/spec/externalName", "value": "modified"}]`, ) @@ -63,7 +64,7 @@ var _ = Describe("Drift", Ordered, func() { }).Should(BeTrue()) By("Changes haven't been rolled back") kw := k.Namespace(namespace) - out, _ := kw.Get("services", "nginx-service", "-o=json") + out, _ := kw.Get("services", "drift-dummy-service", "-o=json") var service corev1.Service _ = json.Unmarshal([]byte(out), &service) Expect(service.Spec.ExternalName).Should(Equal("modified")) @@ -80,7 +81,8 @@ var _ = Describe("Drift", Ordered, func() { JustBeforeEach(func() { kw := k.Namespace(namespace) out, err := kw.Patch( - "service", "nginx-service", + "service", "drift-dummy-service", + "-o=json", "--type=json", "-p", `[{"op": "replace", "path": "/spec/externalName", "value": "modified"}]`, ) @@ -94,10 +96,10 @@ var _ = Describe("Drift", Ordered, func() { }).Should(BeTrue()) Eventually(func() bool { kw := k.Namespace(namespace) - out, _ := kw.Get("services", "nginx-service", "-o=json") + out, _ := kw.Get("services", "drift-dummy-service", "-o=json") var service corev1.Service _ = json.Unmarshal([]byte(out), &service) - return service.Spec.ExternalName == "nginx" + return service.Spec.ExternalName == "drift-dummy" }).Should(BeTrue()) }) }) @@ -106,9 +108,10 @@ var _ = Describe("Drift", Ordered, func() { JustBeforeEach(func() { kw := k.Namespace(namespace) out, err := kw.Patch( - "deployment", "nginx-deployment", + "deployment", "drift-dummy-deployment", + "-o=json", "--type=json", - "-p", `[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value": "nginx:modified"}]`, + "-p", `[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value": "foo:modified"}]`, ) Expect(err).ToNot(HaveOccurred(), out) }) @@ -120,10 +123,10 @@ var _ = Describe("Drift", Ordered, func() { }).Should(BeTrue()) Eventually(func() bool { kw := k.Namespace(namespace) - out, _ := kw.Get("deployment", "nginx-deployment", "-o=json") + out, _ := kw.Get("deployment", "drift-dummy-deployment", "-o=json") var deployment appsv1.Deployment _ = json.Unmarshal([]byte(out), &deployment) - return deployment.Spec.Template.Spec.Containers[0].Image == "nginx:1.14.2" + return deployment.Spec.Template.Spec.Containers[0].Image == "k8s.gcr.io/pause" }).Should(BeTrue()) }) }) @@ -168,7 +171,8 @@ var _ = Describe("Drift", Ordered, func() { JustBeforeEach(func() { kw := k.Namespace(namespace) out, err := kw.Patch( - "service", "nginx-service", + "service", "drift-dummy-service", + "-o=json", "--type=json", "-p", `[{"op": "replace", "path": "/spec/ports/0/port", "value": 1234}]`, ) @@ -179,7 +183,7 @@ var _ = Describe("Drift", Ordered, func() { Eventually(func() string { out, _ := k.Namespace(env.Namespace).Get("bundles", bundleName, "-o=jsonpath={.status.conditions[*].message}") return out - }).Should(ContainSubstring(`service.v1 drift/nginx-service modified {"spec":{"ports":[` + + }).Should(ContainSubstring(`service.v1 drift/drift-dummy-service modified {"spec":{"ports":[` + `{"name":"http","port":80,"protocol":"TCP","targetPort":"http-web-svc"},` + `{"name":"http","port":1234,"protocol":"TCP","targetPort":"http-web-svc"}]}}`)) }) @@ -208,7 +212,8 @@ var _ = Describe("Drift", Ordered, func() { JustBeforeEach(func() { kw := k.Namespace(namespace) out, err := kw.Patch( - "service", "nginx-service", + "service", "drift-dummy-service", + "-o=json", "--type=json", "-p", `[{"op": "replace", "path": "/spec/ports/0/port", "value": 1234}]`, ) @@ -222,7 +227,7 @@ var _ = Describe("Drift", Ordered, func() { }).Should(BeTrue()) Eventually(func() bool { kw := k.Namespace(namespace) - out, _ := kw.Get("services", "nginx-service", "-o=json") + out, _ := kw.Get("services", "drift-dummy-service", "-o=json") var service corev1.Service _ = json.Unmarshal([]byte(out), &service) return service.Spec.Ports[0].Port == 80