Skip to content

Commit

Permalink
fix: chart and filter fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Choudhary <[email protected]>
  • Loading branch information
vishal-chdhry committed Jul 7, 2024
1 parent 5f1d6db commit a2da2c7
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 8 deletions.
4 changes: 4 additions & 0 deletions charts/reports-server/templates/api-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/reports-server/templates/roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 5 additions & 1 deletion config/install-inmemory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,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
app.kubernetes.io/name: reports-server
Expand Down Expand Up @@ -227,6 +227,8 @@ metadata:
app.kubernetes.io/version: "v0.1.0-alpha.1"
app.kubernetes.io/managed-by: Helm
kube-aggregator.kubernetes.io/automanaged: "false"
annotations:
helm.sh/hook: post-install
spec:
group: wgpolicyk8s.io
groupPriorityMinimum: 100
Expand All @@ -249,6 +251,8 @@ metadata:
app.kubernetes.io/version: "v0.1.0-alpha.1"
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
Expand Down
6 changes: 5 additions & 1 deletion config/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,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
app.kubernetes.io/name: reports-server
Expand Down Expand Up @@ -491,6 +491,8 @@ metadata:
app.kubernetes.io/version: "v0.1.0-alpha.1"
app.kubernetes.io/managed-by: Helm
kube-aggregator.kubernetes.io/automanaged: "false"
annotations:
helm.sh/hook: post-install
spec:
group: wgpolicyk8s.io
groupPriorityMinimum: 100
Expand All @@ -513,6 +515,8 @@ metadata:
app.kubernetes.io/version: "v0.1.0-alpha.1"
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
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/cephr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/cpolr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/ephr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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()
Expand Down
8 changes: 3 additions & 5 deletions pkg/api/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/polr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit a2da2c7

Please sign in to comment.