remove deadcode HashObject from k8s.io/kubectl/pkg/util

I can't find evidence that anything is using this anymore, if anyone does depend on this it is a tiny function that depends only on public symbols and they can just place a copy somewhere else.
This commit is contained in:
Benjamin Elder
2025-08-26 15:07:10 -07:00
parent 6cb2849928
commit 4e29dcdf75

View File

@@ -17,7 +17,6 @@ limitations under the License.
package util
import (
"crypto/md5"
"errors"
"fmt"
"path"
@@ -26,7 +25,6 @@ import (
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
// ParseRFC3339 parses an RFC3339 date in either RFC3339Nano or RFC3339 format.
@@ -41,18 +39,6 @@ func ParseRFC3339(s string, nowFn func() metav1.Time) (metav1.Time, error) {
return metav1.Time{Time: t}, nil
}
// HashObject returns the hash of a Object hash by a Codec
func HashObject(obj runtime.Object, codec runtime.Codec) (string, error) {
data, err := runtime.Encode(codec, obj)
if err != nil {
return "", err
}
// TODO: finish removing existing md5 usage
// https://github.com/kubernetes/kubernetes/issues/129652
//nolint:forbidigo
return fmt.Sprintf("%x", md5.Sum(data)), nil
}
// ParseFileSource parses the source given.
//
// Acceptable formats include: