diff --git a/charts/reports-server/templates/api-service.yaml b/charts/reports-server/templates/api-service.yaml index d3c5a2f..02fc3ac 100644 --- a/charts/reports-server/templates/api-service.yaml +++ b/charts/reports-server/templates/api-service.yaml @@ -8,6 +8,8 @@ metadata: labels: {{- include "reports-server.labels" . | nindent 4 }} kube-aggregator.kubernetes.io/automanaged: "false" + annotations: + helm.sh/hook: post-install spec: group: wgpolicyk8s.io groupPriorityMinimum: 100 @@ -28,6 +30,8 @@ metadata: labels: {{- include "reports-server.labels" . | nindent 4 }} kube-aggregator.kubernetes.io/automanaged: "false" + annotations: + helm.sh/hook: post-install spec: group: reports.kyverno.io groupPriorityMinimum: 100 diff --git a/charts/reports-server/templates/roles.yaml b/charts/reports-server/templates/roles.yaml index 66322aa..d022626 100644 --- a/charts/reports-server/templates/roles.yaml +++ b/charts/reports-server/templates/roles.yaml @@ -2,7 +2,7 @@ kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: {{ include "reports-server.fullname" . }} - namespace: kube-system + namespace: {{ $.Release.Namespace }} labels: {{- include "reports-server.labels" . | nindent 4 }} roleRef: diff --git a/config/install-inmemory.yaml b/config/install-inmemory.yaml index 408bd68..e72a396 100644 --- a/config/install-inmemory.yaml +++ b/config/install-inmemory.yaml @@ -105,7 +105,7 @@ kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: reports-server - namespace: kube-system + namespace: reports-server labels: helm.sh/chart: reports-server-0.1.0-alpha.1-n4k.2 app.kubernetes.io/name: reports-server @@ -234,6 +234,8 @@ metadata: app.kubernetes.io/version: "v0.1.0-alpha.1-n4k.2" app.kubernetes.io/managed-by: Helm kube-aggregator.kubernetes.io/automanaged: "false" + annotations: + helm.sh/hook: post-install spec: group: wgpolicyk8s.io groupPriorityMinimum: 100 @@ -256,6 +258,8 @@ metadata: app.kubernetes.io/version: "v0.1.0-alpha.1-n4k.2" app.kubernetes.io/managed-by: Helm kube-aggregator.kubernetes.io/automanaged: "false" + annotations: + helm.sh/hook: post-install spec: group: reports.kyverno.io groupPriorityMinimum: 100 diff --git a/config/install.yaml b/config/install.yaml index b75df9b..a643c1b 100644 --- a/config/install.yaml +++ b/config/install.yaml @@ -134,7 +134,7 @@ kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: reports-server - namespace: kube-system + namespace: reports-server labels: helm.sh/chart: reports-server-0.1.0-alpha.1-n4k.2 app.kubernetes.io/name: reports-server @@ -498,6 +498,8 @@ metadata: app.kubernetes.io/version: "v0.1.0-alpha.1-n4k.2" app.kubernetes.io/managed-by: Helm kube-aggregator.kubernetes.io/automanaged: "false" + annotations: + helm.sh/hook: post-install spec: group: wgpolicyk8s.io groupPriorityMinimum: 100 @@ -520,6 +522,8 @@ metadata: app.kubernetes.io/version: "v0.1.0-alpha.1-n4k.2" app.kubernetes.io/managed-by: Helm kube-aggregator.kubernetes.io/automanaged: "false" + annotations: + helm.sh/hook: post-install spec: group: reports.kyverno.io groupPriorityMinimum: 100 diff --git a/pkg/api/cephr.go b/pkg/api/cephr.go index bc83bd2..ade92a9 100644 --- a/pkg/api/cephr.go +++ b/pkg/api/cephr.go @@ -100,6 +100,7 @@ func (c *cephrStore) List(ctx context.Context, options *metainternalversion.List } } cephrList.ListMeta.ResourceVersion = strconv.FormatUint(resourceVersion, 10) + klog.Infof("filtered list found length: %d", len(cephrList.Items)) return cephrList, nil } @@ -272,6 +273,7 @@ func (c *cephrStore) DeleteCollection(ctx context.Context, deleteValidation rest } func (c *cephrStore) Watch(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error) { + klog.Infof("watching cluster ephemeral reports rv=%s", options.ResourceVersion) switch options.ResourceVersion { case "", "0": return c.broadcaster.Watch() diff --git a/pkg/api/cpolr.go b/pkg/api/cpolr.go index e0d6070..6098679 100644 --- a/pkg/api/cpolr.go +++ b/pkg/api/cpolr.go @@ -100,6 +100,7 @@ func (c *cpolrStore) List(ctx context.Context, options *metainternalversion.List } } cpolrList.ListMeta.ResourceVersion = strconv.FormatUint(resourceVersion, 10) + klog.Infof("filtered list found length: %d", len(cpolrList.Items)) return cpolrList, nil } @@ -271,6 +272,7 @@ func (c *cpolrStore) DeleteCollection(ctx context.Context, deleteValidation rest } func (c *cpolrStore) Watch(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error) { + klog.Infof("watching cluster policy reports rv=%s", options.ResourceVersion) switch options.ResourceVersion { case "", "0": return c.broadcaster.Watch() diff --git a/pkg/api/ephr.go b/pkg/api/ephr.go index 66c0759..7e88ae5 100644 --- a/pkg/api/ephr.go +++ b/pkg/api/ephr.go @@ -103,6 +103,7 @@ func (p *ephrStore) List(ctx context.Context, options *metainternalversion.ListO } } ephrList.ListMeta.ResourceVersion = strconv.FormatUint(resourceVersion, 10) + klog.Infof("filtered list found length: %d", len(ephrList.Items)) return ephrList, nil } @@ -292,6 +293,7 @@ func (p *ephrStore) DeleteCollection(ctx context.Context, deleteValidation rest. } func (p *ephrStore) Watch(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error) { + klog.Infof("watching ephemeral reports rv=%s", options.ResourceVersion) switch options.ResourceVersion { case "", "0": return p.broadcaster.Watch() diff --git a/pkg/api/filter.go b/pkg/api/filter.go index 05aa0a1..8c81ae6 100644 --- a/pkg/api/filter.go +++ b/pkg/api/filter.go @@ -14,16 +14,14 @@ func allowObjectListWatch(object metav1.ObjectMeta, labelSelector labels.Selecto } switch rvmatch { - case metav1.ResourceVersionMatchNotOlderThan: - if rv < desiredRv { - return false, 0, nil - } case metav1.ResourceVersionMatchExact: if rv != desiredRv { return false, 0, nil } default: - break + if rv < desiredRv { + return false, 0, nil + } } if labelSelector == nil { diff --git a/pkg/api/polr.go b/pkg/api/polr.go index c46d45a..fa8424f 100644 --- a/pkg/api/polr.go +++ b/pkg/api/polr.go @@ -103,6 +103,7 @@ func (p *polrStore) List(ctx context.Context, options *metainternalversion.ListO } } polrList.ListMeta.ResourceVersion = strconv.FormatUint(resourceVersion, 10) + klog.Infof("filtered list found length: %d", len(polrList.Items)) return polrList, nil } @@ -292,6 +293,7 @@ func (p *polrStore) DeleteCollection(ctx context.Context, deleteValidation rest. } func (p *polrStore) Watch(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error) { + klog.Infof("watching policy reports rv=%s", options.ResourceVersion) switch options.ResourceVersion { case "", "0": return p.broadcaster.Watch()