From 8b2effa706b7a27dcb089e83af30c59570c857a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Mon, 13 Mar 2023 15:11:37 +0100 Subject: [PATCH] fix: admission reports apiVersion column (#6555) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- api/kyverno/v1alpha2/admission_report_types.go | 12 ++++++------ charts/kyverno/templates/crds/crds.yaml | 12 ++++++------ config/crds/kyverno.io_admissionreports.yaml | 6 +++--- config/crds/kyverno.io_clusteradmissionreports.yaml | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/api/kyverno/v1alpha2/admission_report_types.go b/api/kyverno/v1alpha2/admission_report_types.go index b743d8784a..f8a4b8fc7f 100644 --- a/api/kyverno/v1alpha2/admission_report_types.go +++ b/api/kyverno/v1alpha2/admission_report_types.go @@ -39,9 +39,9 @@ type AdmissionReportSpec struct { // +kubebuilder:object:root=true // +kubebuilder:storageversion // +kubebuilder:resource:shortName=admr,categories=kyverno -// +kubebuilder:printcolumn:name="ApiVersion",type=string,JSONPath=".metadata.ownerReferences[0].apiVersion",priority=1 -// +kubebuilder:printcolumn:name="Kind",type=string,JSONPath=".metadata.ownerReferences[0].kind",priority=1 -// +kubebuilder:printcolumn:name="Subject",type=string,JSONPath=".metadata.ownerReferences[0].name",priority=1 +// +kubebuilder:printcolumn:name="ApiVersion",type=string,JSONPath=".spec.owner.apiVersion",priority=1 +// +kubebuilder:printcolumn:name="Kind",type=string,JSONPath=".spec.owner.kind",priority=1 +// +kubebuilder:printcolumn:name="Subject",type=string,JSONPath=".spec.owner.name",priority=1 // +kubebuilder:printcolumn:name="Pass",type=integer,JSONPath=".spec.summary.pass" // +kubebuilder:printcolumn:name="Fail",type=integer,JSONPath=".spec.summary.fail" // +kubebuilder:printcolumn:name="Warn",type=integer,JSONPath=".spec.summary.warn" @@ -76,9 +76,9 @@ func (r *AdmissionReport) SetSummary(summary policyreportv1alpha2.PolicyReportSu // +kubebuilder:object:root=true // +kubebuilder:storageversion // +kubebuilder:resource:scope=Cluster,shortName=cadmr,categories=kyverno -// +kubebuilder:printcolumn:name="ApiVersion",type=string,JSONPath=".metadata.ownerReferences[0].apiVersion",priority=1 -// +kubebuilder:printcolumn:name="Kind",type=string,JSONPath=".metadata.ownerReferences[0].kind",priority=1 -// +kubebuilder:printcolumn:name="Subject",type=string,JSONPath=".metadata.ownerReferences[0].name",priority=1 +// +kubebuilder:printcolumn:name="ApiVersion",type=string,JSONPath=".spec.owner.apiVersion",priority=1 +// +kubebuilder:printcolumn:name="Kind",type=string,JSONPath=".spec.owner.kind",priority=1 +// +kubebuilder:printcolumn:name="Subject",type=string,JSONPath=".spec.owner.name",priority=1 // +kubebuilder:printcolumn:name="Pass",type=integer,JSONPath=".spec.summary.pass" // +kubebuilder:printcolumn:name="Fail",type=integer,JSONPath=".spec.summary.fail" // +kubebuilder:printcolumn:name="Warn",type=integer,JSONPath=".spec.summary.warn" diff --git a/charts/kyverno/templates/crds/crds.yaml b/charts/kyverno/templates/crds/crds.yaml index fe06ab5fee..254dd915d5 100644 --- a/charts/kyverno/templates/crds/crds.yaml +++ b/charts/kyverno/templates/crds/crds.yaml @@ -25,15 +25,15 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: - - jsonPath: .metadata.ownerReferences[0].apiVersion + - jsonPath: .spec.owner.apiVersion name: ApiVersion priority: 1 type: string - - jsonPath: .metadata.ownerReferences[0].kind + - jsonPath: .spec.owner.kind name: Kind priority: 1 type: string - - jsonPath: .metadata.ownerReferences[0].name + - jsonPath: .spec.owner.name name: Subject priority: 1 type: string @@ -1723,15 +1723,15 @@ spec: scope: Cluster versions: - additionalPrinterColumns: - - jsonPath: .metadata.ownerReferences[0].apiVersion + - jsonPath: .spec.owner.apiVersion name: ApiVersion priority: 1 type: string - - jsonPath: .metadata.ownerReferences[0].kind + - jsonPath: .spec.owner.kind name: Kind priority: 1 type: string - - jsonPath: .metadata.ownerReferences[0].name + - jsonPath: .spec.owner.name name: Subject priority: 1 type: string diff --git a/config/crds/kyverno.io_admissionreports.yaml b/config/crds/kyverno.io_admissionreports.yaml index 83d0d3804e..428f5c7e3b 100644 --- a/config/crds/kyverno.io_admissionreports.yaml +++ b/config/crds/kyverno.io_admissionreports.yaml @@ -20,15 +20,15 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: - - jsonPath: .metadata.ownerReferences[0].apiVersion + - jsonPath: .spec.owner.apiVersion name: ApiVersion priority: 1 type: string - - jsonPath: .metadata.ownerReferences[0].kind + - jsonPath: .spec.owner.kind name: Kind priority: 1 type: string - - jsonPath: .metadata.ownerReferences[0].name + - jsonPath: .spec.owner.name name: Subject priority: 1 type: string diff --git a/config/crds/kyverno.io_clusteradmissionreports.yaml b/config/crds/kyverno.io_clusteradmissionreports.yaml index 50484be699..400799be95 100644 --- a/config/crds/kyverno.io_clusteradmissionreports.yaml +++ b/config/crds/kyverno.io_clusteradmissionreports.yaml @@ -20,15 +20,15 @@ spec: scope: Cluster versions: - additionalPrinterColumns: - - jsonPath: .metadata.ownerReferences[0].apiVersion + - jsonPath: .spec.owner.apiVersion name: ApiVersion priority: 1 type: string - - jsonPath: .metadata.ownerReferences[0].kind + - jsonPath: .spec.owner.kind name: Kind priority: 1 type: string - - jsonPath: .metadata.ownerReferences[0].name + - jsonPath: .spec.owner.name name: Subject priority: 1 type: string