Fix a bug that StatefulSet applies the revision incorrectly

This commit is contained in:
kanchairen
2019-06-10 20:09:37 +08:00
parent 88f8c785b4
commit bf421ae560
2 changed files with 36 additions and 2 deletions

View File

@@ -344,11 +344,12 @@ func ApplyRevision(set *apps.StatefulSet, revision *apps.ControllerRevision) (*a
if err != nil {
return nil, err
}
err = json.Unmarshal(patched, clone)
restoredSet := &apps.StatefulSet{}
err = json.Unmarshal(patched, restoredSet)
if err != nil {
return nil, err
}
return clone, nil
return restoredSet, nil
}
// nextRevision finds the next valid revision number based on revisions. If the length of revisions