mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Schema: Change Subsume check so optionality is respected (#33650)
This commit is contained in:
parent
d6cff74d5a
commit
806761fe70
@ -58,7 +58,10 @@ func mapPanelModel(id string, vcs schema.VersionedCueSchema) cue.Value {
|
||||
panelSchema: maj: in.v.maj
|
||||
panelSchema: min: in.v.min
|
||||
options: in.model.PanelOptions
|
||||
fieldConfig: defaults: custom: in.model.PanelFieldConfig
|
||||
fieldConfig: defaults: custom: {}
|
||||
if in.model.PanelFieldConfig != _|_ {
|
||||
fieldConfig: defaults: custom: in.model.PanelFieldConfig
|
||||
}
|
||||
}
|
||||
`, id, maj, min))
|
||||
|
||||
@ -140,7 +143,8 @@ func readPanelModels(p BaseLoadPaths) (map[string]schema.VersionedCueSchema, err
|
||||
}
|
||||
|
||||
// Ensure the declared value is subsumed by/correct wrt #PanelFamily
|
||||
if err := pmf.Subsume(pmod); err != nil {
|
||||
// TODO not actually sure that Final is what we want here.
|
||||
if err := pmf.Subsume(pmod, cue.Final()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,6 @@ Family: {
|
||||
folderId?: int
|
||||
tags: [...string] | *[]
|
||||
},
|
||||
PanelFieldConfig: {}
|
||||
}
|
||||
]
|
||||
]
|
||||
|
@ -8,8 +8,7 @@ Family: {
|
||||
// empty/missing will default to grafana blog
|
||||
feedUrl?: string
|
||||
useProxy?: bool
|
||||
},
|
||||
PanelFieldConfig: {}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
|
@ -14,8 +14,6 @@ Family: {
|
||||
For markdown syntax help: [commonmark.org/help](https://commonmark.org/help/)
|
||||
"""
|
||||
}
|
||||
|
||||
PanelFieldConfig: {}
|
||||
}
|
||||
]
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user