Merge pull request #97881 from ialidzhikov/nit/unnecessary-type-conversion

Nit: Remove unnecessary type conversion
This commit is contained in:
Kubernetes Prow Robot 2021-03-03 14:39:49 -08:00 committed by GitHub
commit 90ac9cfc58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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{})