- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for DeepHashObject (0.4 sec)
-
pkg/util/hash/hash_test.go
hasher1 := adler32.New() hasher2 := adler32.New() hasher3 := adler32.New() // Act DeepHashObject(hasher1, myUni1) hash1 := hasher1.Sum32() DeepHashObject(hasher1, myUni1) hash1a := hasher1.Sum32() DeepHashObject(hasher2, myUni2) hash2 := hasher2.Sum32() DeepHashObject(hasher3, myUni3) hash3 := hasher3.Sum32() // Assert if hash1 != hash1a {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Mar 27 01:24:22 UTC 2023 - 4.4K bytes - Viewed (0) -
pkg/util/hash/hash.go
*/ package hash import ( "fmt" "hash" "k8s.io/apimachinery/pkg/util/dump" ) // DeepHashObject writes specified object to hash using the spew library // which follows pointers and prints actual values of the nested objects // ensuring the hash does not change when a pointer changes. func DeepHashObject(hasher hash.Hash, objectToWrite interface{}) { hasher.Reset() fmt.Fprintf(hasher, "%v", dump.ForHash(objectToWrite))
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Mar 27 01:24:22 UTC 2023 - 998 bytes - Viewed (0) -
cmd/kubeadm/app/util/staticpod/utils.go
}) return usersAndGroups, err } // DeepHashObject writes specified object to hash using the spew library // which follows pointers and prints actual values of the nested objects // ensuring the hash does not change when a pointer changes. // Copied from k8s.io/kubernetes/pkg/util/hash/hash.go#DeepHashObject func DeepHashObject(hasher hash.Hash, objectToWrite interface{}) { hasher.Reset()
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sun Jan 14 13:07:56 UTC 2024 - 14.1K bytes - Viewed (0) -
pkg/kubelet/config/common.go
} func applyDefaults(pod *api.Pod, source string, isFile bool, nodeName types.NodeName) error { if len(pod.UID) == 0 { hasher := md5.New() hash.DeepHashObject(hasher, pod) // DeepHashObject resets the hash, so we should write the pod source // information AFTER it. if isFile { fmt.Fprintf(hasher, "host:%s", nodeName) fmt.Fprintf(hasher, "file:%s", source) } else {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri Nov 03 18:40:48 UTC 2023 - 5.8K bytes - Viewed (0) -
pkg/kubelet/container/helpers.go
// Note: remember to update hashValues in container_hash_test.go as well. func HashContainer(container *v1.Container) uint64 { hash := fnv.New32a() containerJSON, _ := json.Marshal(pickFieldsToHash(container)) hashutil.DeepHashObject(hash, containerJSON) return uint64(hash.Sum32()) } // pickFieldsToHash pick fields that will affect the running status of the container for hash, // currently this field range only contains `image` and `name`.
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Jun 04 06:25:43 UTC 2024 - 14.3K bytes - Viewed (0) -
pkg/controller/controller_utils.go
// avoid bad words. func ComputeHash(template *v1.PodTemplateSpec, collisionCount *int32) string { podTemplateSpecHasher := fnv.New32a() hashutil.DeepHashObject(podTemplateSpecHasher, *template) // Add collisionCount in the hash if it exists. if collisionCount != nil { collisionCountBytes := make([]byte, 8)
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri Jan 12 15:34:44 UTC 2024 - 47.6K bytes - Viewed (0)