From a3d9f8aab23a3ef9e2fac47faeea0c892545cb78 Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Tue, 2 Jul 2024 14:08:42 -0700 Subject: [PATCH] remove eventID --- pkg/storage/unified/resource/rv.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pkg/storage/unified/resource/rv.go diff --git a/pkg/storage/unified/resource/rv.go b/pkg/storage/unified/resource/rv.go new file mode 100644 index 00000000000..88ec63e4567 --- /dev/null +++ b/pkg/storage/unified/resource/rv.go @@ -0,0 +1,16 @@ +package resource + +import "sync/atomic" + +// The kubernetes storage.Interface tests expect this to be a sequential progression +// SnowflakeIDs do not pass the off-the-shelf k8s tests, although they provide totally +// acceptable values. +type NextResourceVersion = func() int64 + +func newResourceVersionCounter(start int64) NextResourceVersion { + var counter atomic.Int64 + _ = counter.Swap(start + 1) + return func() int64 { + return counter.Add(1) + } +}