mirror of https://github.com/k3s-io/k3s
Merge pull request #66719 from hanxiaoshuai/fix0727
Automatic merge from submit-queue (batch tested with PRs 67938, 66719, 67883). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. return err when Unmarshal failed **What this PR does / why we need it**: return err when Unmarshal failed **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```pull/8/head
commit
256070adcf
|
@ -418,7 +418,9 @@ func getStatefulSetPatch(set *appsv1.StatefulSet) ([]byte, error) {
|
|||
return nil, err
|
||||
}
|
||||
var raw map[string]interface{}
|
||||
json.Unmarshal([]byte(str), &raw)
|
||||
if err := json.Unmarshal([]byte(str), &raw); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
objCopy := make(map[string]interface{})
|
||||
specCopy := make(map[string]interface{})
|
||||
spec := raw["spec"].(map[string]interface{})
|
||||
|
|
Loading…
Reference in New Issue