Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for ForHash (0.31 sec)

  1. staging/src/k8s.io/apimachinery/pkg/util/dump/dump.go

    // The output may change over time, so for guaranteed output please take more direct control
    func Pretty(a interface{}) string {
    	return prettyPrintConfig.Sdump(a)
    }
    
    // ForHash keeps the original Spew.Sprintf format to ensure the same checksum
    func ForHash(a interface{}) string {
    	return prettyPrintConfigForHash.Sprintf("%#v", a)
    }
    
    // OneLine outputs the object in one line
    func OneLine(a interface{}) string {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Mar 27 01:24:22 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  2. pkg/util/hash/hash.go

    // 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/cm/dra/state/checkpoint.go

    		})
    	}
    	oldcheckpoint := &DRAManagerCheckpointWithoutResourceHandles{
    		Version:  checkpointVersion,
    		Entries:  entries,
    		Checksum: 0,
    	}
    	// Calculate checksum for old checkpoint
    	object := dump.ForHash(oldcheckpoint)
    	object = strings.Replace(object, "DRAManagerCheckpointWithoutResourceHandles", "DRAManagerCheckpoint", 1)
    	object = strings.Replace(object, "ClaimInfoStateListWithoutResourceHandles", "ClaimInfoStateList", 1)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 18 15:23:10 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  4. pkg/kubelet/cm/cpumanager/state/checkpoint.go

    	if cp.Checksum == 0 {
    		// accept empty checksum for compatibility with old file backend
    		return nil
    	}
    
    	ck := cp.Checksum
    	cp.Checksum = 0
    	object := dump.ForHash(cp)
    	object = strings.Replace(object, "CPUManagerCheckpointV1", "CPUManagerCheckpoint", 1)
    	cp.Checksum = ck
    
    	hash := fnv.New32a()
    	fmt.Fprintf(hash, "%v", object)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Mar 27 01:24:22 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/util/dump/dump_test.go

    		{map[string]embedwrap{"key": tebw}, "(map[string]dump.embedwrap)map[key:{embed:(dump.embed){s:(string)test} e:(*dump.embed){s:(string)test}}]"},
    	}
    
    	for i, tc := range testCases {
    		s := ForHash(tc.a)
    		if tc.want != s {
    			t.Errorf("[%d]:\n\texpected %q\n\tgot      %q", i, tc.want, s)
    		}
    	}
    }
    
    func TestOneLine(t *testing.T) {
    	tcs := customString("test")
    	tpcs := pCustomString("&test")
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Mar 27 01:24:22 UTC 2023
    - 10.3K bytes
    - Viewed (0)
  6. cmd/kubeadm/app/util/staticpod/utils.go

    // Copied from k8s.io/kubernetes/pkg/util/hash/hash.go#DeepHashObject
    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: Sun Jan 14 13:07:56 UTC 2024
    - 14.1K bytes
    - Viewed (0)
Back to top