Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShortenName ¶
ShortenName deterministically shortens the provided string to the maximum of l characters. The function cannot shorten below a length of 8. This needs to be deterministic, as we use it to find existing resources. ShortenName name will eihter choose CRC64 or CRC32 depending on the requested length l
func ShortenName32 ¶
ShortenName32 deterministically shortens the provided string to the maximum of l characters. The function cannot shorten below a length of 8. It does this by taking the CRC32 has of the complete string, truncate the name to the first l-8 characters, and appending the hash in hex. When using this function for jobs, if we have 10000 active jobs in one namespace, each copying between pvc that start with the same 19 letters, the likelihood of a collision, which would cause the resize operation to fail is about 1 in 10'000. For 1000 active jobs, the likelihood is about 1 in 100'000'000.
func ShortenName64 ¶
ShortenName64 deterministically shortens the provided string to the maximum of l characters. The function cannot shorten below a length of 16. It does this by taking the CRC64 has of the complete string, truncate the name to the first l-16 characters, and appending the hash in hex. When using this function for backup pvcs, if we have 100'000 backups of pvcs, that start with the same ~37 letters, that are longer than ~53 letters, and have the same size, in one namespace, the likelihood of a collision, which would cause old backups to be overwritten is less than 1 in 1 Billion.
Types ¶
This section is empty.