diff --git a/pkg/controller/statefulset/stateful_set_utils.go b/pkg/controller/statefulset/stateful_set_utils.go index 89faba2ccb6..12600fd6323 100644 --- a/pkg/controller/statefulset/stateful_set_utils.go +++ b/pkg/controller/statefulset/stateful_set_utils.go @@ -286,12 +286,12 @@ func Match(ss *apps.StatefulSet, history *apps.ControllerRevision) (bool, error) // PodSpecTemplate. We can modify this later to encompass more state (or less) and remain compatible with previously // recorded patches. func getPatch(set *apps.StatefulSet) ([]byte, error) { - str, err := runtime.Encode(patchCodec, set) + data, err := runtime.Encode(patchCodec, set) if err != nil { return nil, err } var raw map[string]interface{} - json.Unmarshal([]byte(str), &raw) + json.Unmarshal(data, &raw) objCopy := make(map[string]interface{}) specCopy := make(map[string]interface{}) spec := raw["spec"].(map[string]interface{})