Documentation ¶
Index ¶
- Variables
- func Jitter(r *rand.Rand, t time.Duration, jitter float64) time.Duration
- func MakeRandomUUID() string
- func MakeUUIDName(name string, uniqueString string) string
- func MakeUniqueOwnerScopedString(owner *genruntime.ResourceReference, gk schema.GroupKind, namespace string, ...) string
- func MakeUniqueOwnerScopedStringLegacy(owner *genruntime.ResourceReference, gk schema.GroupKind, namespace string, ...) string
Constants ¶
This section is empty.
Variables ¶
var Namespace = uuid.Must(uuid.Parse("9a329043-7ad7-4b1c-812f-9c7a93d6392a"))
Namespace is the ASOv2 UUIDv5 namespace UUID
Functions ¶
func Jitter ¶
Jitter returns the provided duration, scaled by a jitter factor. jitter must be between 0 and 1. After jitter is applied the result will be in the range: [(1-jitter)t, (1+jitter)t], UNLESS (1+jitter)t is larger than MaxInt64, in which case the range will be [(1-jitter)t, math.MaxInt64]
func MakeRandomUUID ¶ added in v2.9.0
func MakeRandomUUID() string
MakeRandomUUID creates a random UUID string. The uuid generated will always be distinct.
func MakeUUIDName ¶ added in v2.2.0
MakeUUIDName creates a stable UUID (v5) if the provided name is not already a UUID based on the specified uniqueString.
func MakeUniqueOwnerScopedString ¶ added in v2.8.0
func MakeUniqueOwnerScopedString(owner *genruntime.ResourceReference, gk schema.GroupKind, namespace string, name string) string
MakeUniqueOwnerScopedString generates a string that uniquely identifies a cluster resource. It includes the following distinguishing parts: * Owner (either group, kind, namespace, name or raw ARM ID) * Group * Kind * Namespace * Name
func MakeUniqueOwnerScopedStringLegacy ¶ added in v2.8.0
func MakeUniqueOwnerScopedStringLegacy(owner *genruntime.ResourceReference, gk schema.GroupKind, namespace string, name string) string
MakeUniqueOwnerScopedStringLegacy preserves the old buggy behavior with ARM ID owners, for now... Deprecated: use MakeUniqueOwnerScopedString instead
Types ¶
This section is empty.