Skip to content

Commit

Permalink
manager: avoid unwanted malformed payload for annotation
Browse files Browse the repository at this point in the history
Co-authored-by: Claudio Netto <nettinhorama@gmail.com>
  • Loading branch information
morpheu and nettoclaudio authored Dec 13, 2022
1 parent 1ab78cb commit c69279f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/pkg/rpaas/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,12 @@ func getAnnotations(params map[string]interface{}) (annotations map[string]strin
if !found {
return
}
err := json.Unmarshal([]byte(p.(string)), &annotations)
annotationsStr, ok := p.(string)
if !ok {
return
}

err := json.Unmarshal([]byte(annotationsStr), &annotations)
if err != nil {
return
}
Expand Down

0 comments on commit c69279f

Please sign in to comment.