diff --git a/pkg/api/cephr.go b/pkg/api/cephr.go index ade92a9..248cb77 100644 --- a/pkg/api/cephr.go +++ b/pkg/api/cephr.go @@ -291,16 +291,9 @@ func (c *cephrStore) Watch(ctx context.Context, options *metainternalversion.Lis events := make([]watch.Event, len(list.Items)) for i, pol := range list.Items { report := pol.DeepCopy() - if report.Generation == 1 || report.Generation == 0 { - events[i] = watch.Event{ - Type: watch.Added, - Object: report, - } - } else { - events[i] = watch.Event{ - Type: watch.Modified, - Object: report, - } + events[i] = watch.Event{ + Type: watch.Added, + Object: report, } } return c.broadcaster.WatchWithPrefix(events) diff --git a/pkg/api/cpolr.go b/pkg/api/cpolr.go index 6098679..ad3ff02 100644 --- a/pkg/api/cpolr.go +++ b/pkg/api/cpolr.go @@ -290,16 +290,9 @@ func (c *cpolrStore) Watch(ctx context.Context, options *metainternalversion.Lis events := make([]watch.Event, len(list.Items)) for i, pol := range list.Items { report := pol.DeepCopy() - if report.Generation == 1 || report.Generation == 0 { - events[i] = watch.Event{ - Type: watch.Added, - Object: report, - } - } else { - events[i] = watch.Event{ - Type: watch.Modified, - Object: report, - } + events[i] = watch.Event{ + Type: watch.Added, + Object: report, } } return c.broadcaster.WatchWithPrefix(events) diff --git a/pkg/api/ephr.go b/pkg/api/ephr.go index 7e88ae5..d71fced 100644 --- a/pkg/api/ephr.go +++ b/pkg/api/ephr.go @@ -311,16 +311,9 @@ func (p *ephrStore) Watch(ctx context.Context, options *metainternalversion.List events := make([]watch.Event, len(list.Items)) for i, pol := range list.Items { report := pol.DeepCopy() - if report.Generation == 1 || report.Generation == 0 { - events[i] = watch.Event{ - Type: watch.Added, - Object: report, - } - } else { - events[i] = watch.Event{ - Type: watch.Modified, - Object: report, - } + events[i] = watch.Event{ + Type: watch.Added, + Object: report, } } return p.broadcaster.WatchWithPrefix(events) diff --git a/pkg/api/filter.go b/pkg/api/filter.go index 8c81ae6..79ef0c1 100644 --- a/pkg/api/filter.go +++ b/pkg/api/filter.go @@ -1,35 +1,33 @@ package api import ( - "strconv" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" ) func allowObjectListWatch(object metav1.ObjectMeta, labelSelector labels.Selector, desiredRv uint64, rvmatch metav1.ResourceVersionMatch) (bool, uint64, error) { - rv, err := strconv.ParseUint(object.ResourceVersion, 10, 64) - if err != nil { - return false, 0, err - } + // rv, err := strconv.ParseUint(object.ResourceVersion, 10, 64) + // if err != nil { + // return false, 0, err + // } - switch rvmatch { - case metav1.ResourceVersionMatchExact: - if rv != desiredRv { - return false, 0, nil - } - default: - if rv < desiredRv { - return false, 0, nil - } - } + // switch rvmatch { + // case metav1.ResourceVersionMatchExact: + // if rv != desiredRv { + // return false, 0, nil + // } + // default: + // if rv < desiredRv { + // return false, 0, nil + // } + // } if labelSelector == nil { - return true, rv, nil + return true, 1, nil } if labelSelector.Matches(labels.Set(object.Labels)) { - return true, rv, nil + return true, 1, nil } else { return false, 0, nil } diff --git a/pkg/api/polr.go b/pkg/api/polr.go index fa8424f..717fec5 100644 --- a/pkg/api/polr.go +++ b/pkg/api/polr.go @@ -311,16 +311,9 @@ func (p *polrStore) Watch(ctx context.Context, options *metainternalversion.List events := make([]watch.Event, len(list.Items)) for i, pol := range list.Items { report := pol.DeepCopy() - if report.Generation == 1 || report.Generation == 0 { - events[i] = watch.Event{ - Type: watch.Added, - Object: report, - } - } else { - events[i] = watch.Event{ - Type: watch.Modified, - Object: report, - } + events[i] = watch.Event{ + Type: watch.Added, + Object: report, } } return p.broadcaster.WatchWithPrefix(events)