diff --git a/test/e2e/network/BUILD b/test/e2e/network/BUILD index 6e20bfbfc911..49fce64e0d60 100644 --- a/test/e2e/network/BUILD +++ b/test/e2e/network/BUILD @@ -49,6 +49,7 @@ go_library( "//staging/src/k8s.io/api/rbac/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/fields:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", diff --git a/test/e2e/network/ingress.go b/test/e2e/network/ingress.go index f1bce918e8f5..01a33ee65655 100644 --- a/test/e2e/network/ingress.go +++ b/test/e2e/network/ingress.go @@ -33,6 +33,7 @@ import ( rbacv1 "k8s.io/api/rbac/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/uuid" @@ -1141,6 +1142,14 @@ var _ = SIGDescribe("Ingress API", func() { framework.ExpectNoError(err) framework.ExpectEqual(updatedStatus.Status.LoadBalancer, statusToUpdate.Status.LoadBalancer, fmt.Sprintf("updated object expected to have updated loadbalancer status %#v, got %#v", statusToUpdate.Status.LoadBalancer, updatedStatus.Status.LoadBalancer)) + ginkgo.By("get /status") + ingResource := schema.GroupVersionResource{Group: "networking.k8s.io", Version: ingVersion, Resource: "ingresses"} + gottenStatus, err := f.DynamicClient.Resource(ingResource).Namespace(ns).Get(context.TODO(), createdIngress.Name, metav1.GetOptions{}, "status") + framework.ExpectNoError(err) + statusUID, _, err := unstructured.NestedFieldCopy(gottenStatus.Object, "metadata", "uid") + framework.ExpectNoError(err) + framework.ExpectEqual(string(createdIngress.UID), statusUID, fmt.Sprintf("createdIngress.UID: %v expected to match statusUID: %v ", createdIngress.UID, statusUID)) + // Ingress resource delete operations ginkgo.By("deleting") err = ingClient.Delete(context.TODO(), createdIngress.Name, metav1.DeleteOptions{})