handle Unmarshal error

Signed-off-by: hantmac <hantmac@outlook.com>
This commit is contained in:
hantmac 2021-05-13 21:22:59 +08:00
parent f35e587087
commit 619fff10ea

View File

@ -291,7 +291,10 @@ func getPatch(set *apps.StatefulSet) ([]byte, error) {
return nil, err
}
var raw map[string]interface{}
json.Unmarshal(data, &raw)
err = json.Unmarshal(data, &raw)
if err != nil {
return nil, err
}
objCopy := make(map[string]interface{})
specCopy := make(map[string]interface{})
spec := raw["spec"].(map[string]interface{})