feat: export metadata-less YAML resources (#96829)

* feat: export metadata-less YAML resources

* feat: add option to prefer YAML
This commit is contained in:
Mariell Hoversholm authored and GitHub committed 2024-11-21 14:14:30 +01:00
1 parent 079f47221d
commit ed0db3d0e0
4 files changed
+31 -8

No files matched your search

+5
View File
@@ -87,6 +87,11 @@ type RepositorySpec struct {
// The value is a reference to the Kubernetes metadata name of the folder in the same namespace.
Folder string `json:"folder,omitempty"`
// Should we prefer emitting YAML for this repository, e.g. upon export?
// Editing existing dashboards will continue to emit the file format used in the repository. (TODO: implement this)
// If you delete and then recreate a dashboard, it will switch to the preferred format.
PreferYAML bool `json:"preferYaml,omitempty"`
// Edit options within the repository
Editing EditingOptions `json:"editing"`
@@ -305,6 +305,13 @@ func schema_pkg_apis_provisioning_v0alpha1_RepositorySpec(ref common.ReferenceCa
Format: "",
},
},
"preferYaml": {
SchemaProps: spec.SchemaProps{
Description: "Should we prefer emitting YAML for this repository, e.g. upon export? Editing existing dashboards will continue to emit the file format used in the repository. (TODO: implement this) If you delete and then recreate a dashboard, it will switch to the preferred format.",
Type: []string{"boolean"},
Format: "",
},
},
"editing": {
SchemaProps: spec.SchemaProps{
Description: "Edit options within the repository",
@@ -1,2 +1,3 @@
API rule violation: list_type_missing,github.com/grafana/grafana/pkg/apis/provisioning/v0alpha1,ResourceWrapper,Errors
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/provisioning/v0alpha1,RepositorySpec,GitHub
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/provisioning/v0alpha1,RepositorySpec,PreferYAML