From e731ccd65074312f3f11b42f9a7bc0636cda1a31 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Thu, 17 Feb 2022 00:13:25 -0500 Subject: [PATCH] Update storage/handler unit tests to set / expect namespace in object --- staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go b/staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go index db9ca568bd0..1e2e7d55ae5 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go @@ -3505,6 +3505,7 @@ func TestNamedCreaterWithGenerateName(t *testing.T) { itemOut.GetObjectKind().SetGroupVersionKind(schema.GroupVersionKind{}) simple.Name = populateName + simple.Namespace = "default" // populated by create handler to match request URL if !reflect.DeepEqual(&itemOut, simple) { t.Errorf("Unexpected data: %#v, expected %#v (%s)", itemOut, simple, string(body)) } @@ -3583,6 +3584,7 @@ func TestCreate(t *testing.T) { } itemOut.GetObjectKind().SetGroupVersionKind(schema.GroupVersionKind{}) + simple.Namespace = "default" // populated by create handler to match request URL if !reflect.DeepEqual(&itemOut, simple) { t.Errorf("Unexpected data: %#v, expected %#v (%s)", itemOut, simple, string(body)) } @@ -3644,6 +3646,7 @@ func TestCreateYAML(t *testing.T) { } itemOut.GetObjectKind().SetGroupVersionKind(schema.GroupVersionKind{}) + simple.Namespace = "default" // populated by create handler to match request URL if !reflect.DeepEqual(&itemOut, simple) { t.Errorf("Unexpected data: %#v, expected %#v (%s)", itemOut, simple, string(body)) } @@ -3695,6 +3698,7 @@ func TestCreateInNamespace(t *testing.T) { } itemOut.GetObjectKind().SetGroupVersionKind(schema.GroupVersionKind{}) + simple.Namespace = "other" // populated by create handler to match request URL if !reflect.DeepEqual(&itemOut, simple) { t.Errorf("Unexpected data: %#v, expected %#v (%s)", itemOut, simple, string(body)) }