Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for DeepHashObject (0.13 sec)

  1. 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)
  2. 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)
  3. 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)
Back to top