Unverified Commit 256070ad authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

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 ```
parents b5382c34 6c94d7ae
...@@ -418,7 +418,9 @@ func getStatefulSetPatch(set *appsv1.StatefulSet) ([]byte, error) { ...@@ -418,7 +418,9 @@ func getStatefulSetPatch(set *appsv1.StatefulSet) ([]byte, error) {
return nil, err return nil, err
} }
var raw map[string]interface{} 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{}) objCopy := make(map[string]interface{})
specCopy := make(map[string]interface{}) specCopy := make(map[string]interface{})
spec := raw["spec"].(map[string]interface{}) spec := raw["spec"].(map[string]interface{})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment