mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-30 03:15:05 +00:00
fix assign to nil map
This commit is contained in:
parent
77d9634604
commit
05d5d91afd
1 changed files with 1 additions and 0 deletions
|
@ -127,6 +127,7 @@ func addingDefaultFieldsToSchema(schemaRaw []byte) []byte {
|
|||
_ = json.Unmarshal(schemaRaw, &schema)
|
||||
|
||||
if schema.Properties["apiVersion"] == nil {
|
||||
schema.Properties = make(map[string]interface{})
|
||||
apiVersionDefRaw := `{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"}`
|
||||
apiVersionDef := make(map[string]interface{})
|
||||
_ = json.Unmarshal([]byte(apiVersionDefRaw), &apiVersionDef)
|
||||
|
|
Loading…
Add table
Reference in a new issue