delete unused functions in pkg/controller directory

This commit is contained in:
HirazawaUi
2023-01-16 15:06:05 +08:00
parent c3e7eca7fd
commit 397cc73dc9
4 changed files with 0 additions and 130 deletions

View File

@@ -17,7 +17,6 @@ limitations under the License.
package statefulset
import (
"bytes"
"encoding/json"
"fmt"
"regexp"
@@ -481,18 +480,6 @@ func newVersionedStatefulSetPod(currentSet, updateSet *apps.StatefulSet, current
return pod
}
// Match check if the given StatefulSet's template matches the template stored in the given history.
func Match(ss *apps.StatefulSet, history *apps.ControllerRevision) (bool, error) {
// Encoding the set for the patch may update its GVK metadata, which causes data races if this
// set is in an informer cache.
clone := ss.DeepCopy()
patch, err := getPatch(clone)
if err != nil {
return false, err
}
return bytes.Equal(patch, history.Data.Raw), nil
}
// getPatch returns a strategic merge patch that can be applied to restore a StatefulSet to a
// previous version. If the returned error is nil the patch is valid. The current state that we save is just the
// PodSpecTemplate. We can modify this later to encompass more state (or less) and remain compatible with previously