Use hashutil to hold hash tools

This commit is contained in:
harry
2016-01-05 15:31:20 +08:00
committed by Harry Zhang
parent d6ab35a088
commit 2a52976983
7 changed files with 13 additions and 13 deletions

View File

@@ -27,7 +27,7 @@ import (
"k8s.io/kubernetes/pkg/api/validation"
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/hash"
utilyaml "k8s.io/kubernetes/pkg/util/yaml"
"github.com/golang/glog"
@@ -47,7 +47,7 @@ func applyDefaults(pod *api.Pod, source string, isFile bool, nodeName string) er
} else {
fmt.Fprintf(hasher, "url:%s", source)
}
util.DeepHashObject(hasher, pod)
hash.DeepHashObject(hasher, pod)
pod.UID = types.UID(hex.EncodeToString(hasher.Sum(nil)[0:]))
glog.V(5).Infof("Generated UID %q pod %q from %s", pod.UID, pod.Name, source)
}