Documentation ¶
Overview ¶
Package hash allows the user to get a hash number for a given Kubernetes object. This is useful to detect when a derived resource need to be changed too.
The code in this package is adapted from:
https://github.com/kubernetes/kubernetes/blob/master/pkg/util/hash/hash.go // wokeignore:rule=master https://github.com/kubernetes/kubernetes/blob/ea07644/pkg/controller/controller_utils.go#L1189
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeHash ¶
ComputeHash returns a hash value calculated from pod template and a collisionCount to avoid hash collision. The hash will be safe encoded to avoid bad words.
func ComputeVersionedHash ¶ added in v1.19.6
ComputeVersionedHash follows the same rules of ComputeHash with the exception that accepts also a epoc value. The epoc value is used to generate a new hash from a same object. This is useful to force a new hash even if the original object is not changed. A practical use is to force a reconciliation loop of the object.
func DeepHashObject ¶
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.
Types ¶
This section is empty.