mirror of
https://github.com/rancher/steve.git
synced 2025-09-09 03:09:50 +00:00
chaging it replace apiVersion and kind from input to schema
This commit is contained in:
@@ -529,15 +529,7 @@ func (s *Store) Create(apiOp *types.APIRequest, schema *types.APISchema, params
|
||||
}
|
||||
|
||||
gvk := attributes.GVK(schema)
|
||||
apiVersion, kind := gvk.ToAPIVersionAndKind()
|
||||
|
||||
if value, found := input["apiVersion"]; !found || value == "" {
|
||||
input["apiVersion"] = apiVersion
|
||||
}
|
||||
|
||||
if value, found := input["kind"]; !found || value == "" {
|
||||
input["kind"] = kind
|
||||
}
|
||||
input["apiVersion"], input["kind"] = gvk.ToAPIVersionAndKind()
|
||||
|
||||
buffer := WarningBuffer{}
|
||||
k8sClient, err := metricsStore.Wrap(s.clientGetter.TableClient(apiOp, schema, namespace, &buffer))
|
||||
@@ -611,15 +603,7 @@ func (s *Store) Update(apiOp *types.APIRequest, schema *types.APISchema, params
|
||||
}
|
||||
|
||||
gvk := attributes.GVK(schema)
|
||||
apiVersion, kind := gvk.ToAPIVersionAndKind()
|
||||
|
||||
if value, found := input["apiVersion"]; !found || value == "" {
|
||||
input["apiVersion"] = apiVersion
|
||||
}
|
||||
|
||||
if value, found := input["kind"]; !found || value == "" {
|
||||
input["kind"] = kind
|
||||
}
|
||||
input["apiVersion"], input["kind"] = gvk.ToAPIVersionAndKind()
|
||||
|
||||
opts := metav1.UpdateOptions{}
|
||||
if err := decodeParams(apiOp, &opts); err != nil {
|
||||
|
Reference in New Issue
Block a user