mirror of
https://github.com/rancher/norman.git
synced 2025-08-31 06:35:09 +00:00
Breakout merge that allows changing metadata and status
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func APIUpdateMerge(schema *types.Schema, schemas *types.Schemas, dest, src map[string]interface{}, replace bool) map[string]interface{} {
|
||||
result := mergeMaps("", nil, schema, schemas, replace, dest, src)
|
||||
result := UpdateMerge(schema, schemas, dest, src, replace)
|
||||
if s, ok := dest["status"]; ok {
|
||||
result["status"] = s
|
||||
}
|
||||
@@ -19,6 +19,10 @@ func APIUpdateMerge(schema *types.Schema, schemas *types.Schemas, dest, src map[
|
||||
return result
|
||||
}
|
||||
|
||||
func UpdateMerge(schema *types.Schema, schemas *types.Schemas, dest, src map[string]interface{}, replace bool) map[string]interface{} {
|
||||
return mergeMaps("", nil, schema, schemas, replace, dest, src)
|
||||
}
|
||||
|
||||
func isProtected(k string) bool {
|
||||
if !strings.Contains(k, "cattle.io/") || (isField(k) && k != "field.cattle.io/creatorId") {
|
||||
return false
|
||||
|
Reference in New Issue
Block a user