Allow arbitrary data in Details map in results #1130
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.
What this PR does / why we need it:
The previous
Details
structure in the Sonobuoy results format was amap[string]string
. As we are creating more plugins that are providingreports in the Sonobuoy results format, this structure is limiting. To
allow more flexibility, the type is being changed to
map[string]interface{}
to allow plugins to provide arbitrary data inthe
Details
field.The version of the YAML library used when parsing the results in a
results tarball has been upgraded to v3. This is due to the fact that it
unmarshals data into a
map[string]interface{}
type when all the keysare strings. In v2, the behaviour was to always marshal to
map[interface{}]interface{}
. This is important as if the keys are notstrings then marshalling to JSON will fail when using the
--detailed
mode of the
results
command.See: go-yaml/yaml#384 and go-yaml/yaml#591.
Signed-off-by: Bridget McErlean [email protected]
Release note: