Merge pull request #95012 from nodo/add-namespace-to-post-based-namespace-creation

Make the creation of namespace using POST and PATCH consistent
This commit is contained in:
Kubernetes Prow Robot
2020-10-01 17:37:20 -07:00
committed by GitHub
5 changed files with 64 additions and 10 deletions

View File

@@ -218,8 +218,8 @@ func (h *holder) reset(t *testing.T) {
}
}
func (h *holder) expect(gvr schema.GroupVersionResource, gvk, optionsGVK schema.GroupVersionKind, operation v1beta1.Operation, name, namespace string, object, oldObject, options bool) {
// Special-case namespaces, since the object name shows up in request attributes for update/delete requests
if len(namespace) == 0 && gvk.Group == "" && gvk.Version == "v1" && gvk.Kind == "Namespace" && operation != v1beta1.Create {
// Special-case namespaces, since the object name shows up in request attributes
if len(namespace) == 0 && gvk.Group == "" && gvk.Version == "v1" && gvk.Kind == "Namespace" {
namespace = name
}