mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-06 03:33:26 +00:00
Make DeepHashObject function deterministic.
This commit is contained in:
@@ -26,5 +26,6 @@ import (
|
||||
// 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{}) {
|
||||
spew.Fprintf(hasher, "%#v", objectToWrite)
|
||||
printer := spew.ConfigState{Indent: " ", SortKeys: true}
|
||||
printer.Fprintf(hasher, "%#v", objectToWrite)
|
||||
}
|
||||
|
Reference in New Issue
Block a user