[BUGFIX] Fix YAML files not working for provisioning #1589
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When using YAML files for initial provisioning (located in a folder defined in the
config.yaml
file'sprovisioning.folders
field),Perses fails to load the
Dashboard
andGlobalDatasource
definitions throwing the following error:I turns out this is caused by the
gopkg.in/yaml.v2
library unmarshaling some YAML parts (specifically thePlugin
spec) intomap[interface {}]interface {}
, which is not supported for marashaling by Go standard library'senconding/json
.This PR:
gopkg.in/yaml.v3
package which usesmap[string]interface{}
(supported byencoding/json
), thus fixing the errors;github.com/json-iterator/go
, because previously it was only added to address the exact issue described above (apparently that did not fix it completely), and now that it is addressed by the YAML package update there is no further need for it;percli version
to have bigger indentation, becausegopkg.in/yaml.v3
uses 4 spaces for indentation by default (compared to 2 spaces ingopkg.in/yaml.v2
).Checklist
[<catalog_entry>] <commit message>
naming convention using one of the followingcatalog_entry
values:FEATURE
,ENHANCEMENT
,BUGFIX
,BREAKINGCHANGE
,IGNORE
.