Skip to content
This repository has been archived by the owner on Nov 18, 2019. It is now read-only.

Commit

Permalink
Convert Credentials into a map respecting json tags (#57)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha authored Mar 28, 2019
1 parent 64e27a6 commit bb1dbe9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/kubedb/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,14 @@ type Credentials struct {
// }
// }
func (c Credentials) ToMap() (map[string]interface{}, error) {
data, err := json.Marshal(c)
if err != nil {
return nil, err
}
var result map[string]interface{}
err := mu.Decode(&c, &result)
return result, err
err = json.Unmarshal(data, &result)
if err != nil {
return nil, err
}
return result, nil
}

0 comments on commit bb1dbe9

Please sign in to comment.