Remove unnecessary type conversion

Signed-off-by: ialidzhikov <i.alidjikov@gmail.com>
This commit is contained in:
ialidzhikov 2021-01-09 22:43:29 +02:00
parent e1f84d52b7
commit e1e7c39b47

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