mirror of
https://github.com/niusmallnan/steve.git
synced 2025-08-28 09:41:34 +00:00
Set namespace to request namespace on create if namespace is empty
This commit is contained in:
parent
1d84c1fc9f
commit
8f5ca57628
@ -372,6 +372,10 @@ func (s *Store) Create(apiOp *types.APIRequest, schema *types.APISchema, params
|
||||
if name == "" && input.String("metadata", "generateName") == "" {
|
||||
input.SetNested(schema.ID[0:1]+"-", "metadata", "generatedName")
|
||||
}
|
||||
if ns == "" && apiOp.Namespace != "" {
|
||||
ns = apiOp.Namespace
|
||||
input.SetNested(ns, "metadata", "namespace")
|
||||
}
|
||||
|
||||
gvk := attributes.GVK(schema)
|
||||
input["apiVersion"], input["kind"] = gvk.ToAPIVersionAndKind()
|
||||
|
Loading…
Reference in New Issue
Block a user