Skip to content

Commit

Permalink
Update pkg/stores/proxy/proxy_store.go
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Lebreux <tom.lebreux@suse.com>
  • Loading branch information
gehrkefc and tomleb authored Sep 5, 2024
1 parent 887912f commit 852a656
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions pkg/stores/proxy/proxy_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,18 +434,15 @@ func (s *Store) Create(apiOp *types.APIRequest, schema *types.APISchema, params
input.SetNested(schema.ID[0:1]+"-", "metadata", "generateName")
}

if attributes.Namespaced(schema) {
if namespace == "" {
if apiOp.Namespace == "" {
return nil, nil, validation.ErrorCode{
Status: http.StatusUnprocessableEntity,
Code: errNamespaceRequired,
}
if attributes.Namespaced(schema) && namespace == "" {
if apiOp.Namespace == "" {
return nil, nil, validation.ErrorCode{
Status: http.StatusUnprocessableEntity,
Code: errNamespaceRequired,
}

namespace = apiOp.Namespace
}

namespace = apiOp.Namespace
input.SetNested(namespace, "metadata", "namespace")
}

Expand Down

0 comments on commit 852a656

Please sign in to comment.