Skip to content

Commit

Permalink
fix(diff): diff with nested dashboard element (grafana#41)
Browse files Browse the repository at this point in the history
As parseDashboards got refactored out, the nesting from the API didn't
line up anymore with the rendered dashboards. This generated a broken
diff.

Ref for the original change: d58bc1a
  • Loading branch information
Duologic authored Aug 26, 2020
1 parent bf89136 commit 242b5b3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/grizzly/grafana.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,16 @@ func getDashboard(config Config, uid string) (*Board, error) {
return nil, err
}

var board Board
if err := json.Unmarshal(data, &board); err != nil {
type nestedBoard struct {
Dashboard Board `json:"dashboard"`
}
var b nestedBoard
if err := json.Unmarshal(data, &b); err != nil {
return nil, APIErr{err, data}
}

board := Board{Dashboard: b.Dashboard.Dashboard}

return &board, nil
}

Expand Down

0 comments on commit 242b5b3

Please sign in to comment.