-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix export_dashboards command #8954
Conversation
`panelJSON` is/can be an array, so marshaling to MapStr caused problems. I think this was the root cause for elastic#8952.
@@ -117,7 +117,7 @@ func decodeValue(data common.MapStr, key string) { | |||
return | |||
} | |||
s := v.(string) | |||
var d common.MapStr | |||
var d interface{} | |||
json.Unmarshal([]byte(s), &d) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is lax on error handling. Checking the Unmarshal
result and returning an error or panicking would be helpful.
@joshuar @ycombinator Haven't tested it but it might also fix #8200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I can follow up on the error handling in #7730
@andrewkroh @tsg Here is the commit for #7730 for the error handling 9ff0847 |
This dashboard was probably exported prior to the fix for elastic#8954. Fixes elastic#9850
This dashboard was probably exported prior to the fix for elastic#8954. Fixes elastic#9850 (cherry picked from commit eddf69e)
This dashboard was probably exported prior to the fix for elastic#8954. Fixes elastic#9850 (cherry picked from commit eddf69e)
This dashboard was probably exported prior to the fix for elastic#8954. Fixes elastic#9850 (cherry picked from commit cbbb7dd)
panelJSON
is/can be an array, so marshaling to MapStr causedproblems. I think this was the root cause for #8952.