From 8eb1d3988c22d684661551abf353b2c755e46b40 Mon Sep 17 00:00:00 2001 From: Santosh Kaluskar <91916466+Santosh1176@users.noreply.github.com> Date: Tue, 25 Oct 2022 00:58:23 +0530 Subject: [PATCH] Add AGE in printer columns of CRDs (#5119) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add AGE in printer columns of CRDs Signed-off-by: Santosh Kaluskar * codegen Signed-off-by: Charles-Edouard Brétéché Signed-off-by: Santosh Kaluskar Signed-off-by: Charles-Edouard Brétéché Signed-off-by: Charles-Edouard Brétéché Co-authored-by: Charles-Edouard Brétéché Co-authored-by: Charles-Edouard Brétéché --- api/kyverno/v1/clusterpolicy_types.go | 1 + api/kyverno/v1/policy_types.go | 1 + api/kyverno/v2beta1/clusterpolicy_types.go | 1 + api/kyverno/v2beta1/policy_types.go | 1 + charts/kyverno/templates/crds.yaml | 12 ++++++++ config/crds/kyverno.io_clusterpolicies.yaml | 6 ++++ config/crds/kyverno.io_policies.yaml | 6 ++++ config/install.yaml | 33 +++++++++++++++++++++ config/install_debug.yaml | 33 +++++++++++++++++++++ 9 files changed, 94 insertions(+) mode change 100755 => 100644 api/kyverno/v1/policy_types.go mode change 100755 => 100644 api/kyverno/v2beta1/policy_types.go diff --git a/api/kyverno/v1/clusterpolicy_types.go b/api/kyverno/v1/clusterpolicy_types.go index 1f7ce0a4a7..fa6595069c 100644 --- a/api/kyverno/v1/clusterpolicy_types.go +++ b/api/kyverno/v1/clusterpolicy_types.go @@ -18,6 +18,7 @@ import ( // +kubebuilder:printcolumn:name="Validate Action",type=string,JSONPath=".spec.validationFailureAction" // +kubebuilder:printcolumn:name="Failure Policy",type=string,JSONPath=".spec.failurePolicy",priority=1 // +kubebuilder:printcolumn:name="Ready",type=boolean,JSONPath=`.status.ready` +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:storageversion // ClusterPolicy declares validation, mutation, and generation behaviors for matching resources. diff --git a/api/kyverno/v1/policy_types.go b/api/kyverno/v1/policy_types.go old mode 100755 new mode 100644 index 7d8771431d..9d76926559 --- a/api/kyverno/v1/policy_types.go +++ b/api/kyverno/v1/policy_types.go @@ -16,6 +16,7 @@ import ( // +kubebuilder:printcolumn:name="Validate Action",type=string,JSONPath=".spec.validationFailureAction" // +kubebuilder:printcolumn:name="Failure Policy",type=string,JSONPath=".spec.failurePolicy",priority=1 // +kubebuilder:printcolumn:name="Ready",type=boolean,JSONPath=`.status.ready` +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:resource:shortName=pol,categories=kyverno;all // +kubebuilder:storageversion diff --git a/api/kyverno/v2beta1/clusterpolicy_types.go b/api/kyverno/v2beta1/clusterpolicy_types.go index 53361b8b73..29ed97e01b 100644 --- a/api/kyverno/v2beta1/clusterpolicy_types.go +++ b/api/kyverno/v2beta1/clusterpolicy_types.go @@ -19,6 +19,7 @@ import ( // +kubebuilder:printcolumn:name="Validate Action",type=string,JSONPath=".spec.validationFailureAction" // +kubebuilder:printcolumn:name="Failure Policy",type=string,JSONPath=".spec.failurePolicy",priority=1 // +kubebuilder:printcolumn:name="Ready",type=boolean,JSONPath=`.status.ready` +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" // ClusterPolicy declares validation, mutation, and generation behaviors for matching resources. type ClusterPolicy struct { diff --git a/api/kyverno/v2beta1/policy_types.go b/api/kyverno/v2beta1/policy_types.go old mode 100755 new mode 100644 index ba8ad93dbd..90a40b1df1 --- a/api/kyverno/v2beta1/policy_types.go +++ b/api/kyverno/v2beta1/policy_types.go @@ -17,6 +17,7 @@ import ( // +kubebuilder:printcolumn:name="Validate Action",type=string,JSONPath=".spec.validationFailureAction" // +kubebuilder:printcolumn:name="Failure Policy",type=string,JSONPath=".spec.failurePolicy",priority=1 // +kubebuilder:printcolumn:name="Ready",type=boolean,JSONPath=`.status.ready` +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:resource:shortName=pol,categories=kyverno;all // Policy declares validation, mutation, and generation behaviors for matching resources. diff --git a/charts/kyverno/templates/crds.yaml b/charts/kyverno/templates/crds.yaml index cf4f47dd50..f3b554c8e2 100644 --- a/charts/kyverno/templates/crds.yaml +++ b/charts/kyverno/templates/crds.yaml @@ -1026,6 +1026,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v1 schema: openAPIV3Schema: @@ -4653,6 +4656,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v2beta1 schema: openAPIV3Schema: @@ -8610,6 +8616,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v1 schema: openAPIV3Schema: @@ -12237,6 +12246,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v2beta1 schema: openAPIV3Schema: diff --git a/config/crds/kyverno.io_clusterpolicies.yaml b/config/crds/kyverno.io_clusterpolicies.yaml index 884692494f..49a3910bc4 100644 --- a/config/crds/kyverno.io_clusterpolicies.yaml +++ b/config/crds/kyverno.io_clusterpolicies.yaml @@ -34,6 +34,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v1 schema: openAPIV3Schema: @@ -5882,6 +5885,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v2beta1 schema: openAPIV3Schema: diff --git a/config/crds/kyverno.io_policies.yaml b/config/crds/kyverno.io_policies.yaml index b6b5277202..87c05ffd0c 100644 --- a/config/crds/kyverno.io_policies.yaml +++ b/config/crds/kyverno.io_policies.yaml @@ -34,6 +34,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v1 schema: openAPIV3Schema: @@ -5884,6 +5887,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v2beta1 schema: openAPIV3Schema: diff --git a/config/install.yaml b/config/install.yaml index 4383699f68..1019c0d5d0 100644 --- a/config/install.yaml +++ b/config/install.yaml @@ -26,6 +26,9 @@ metadata: spec: group: kyverno.io names: + categories: + - kyverno + - all kind: AdmissionReport listKind: AdmissionReportList plural: admissionreports @@ -367,6 +370,9 @@ metadata: spec: group: kyverno.io names: + categories: + - kyverno + - all kind: BackgroundScanReport listKind: BackgroundScanReportList plural: backgroundscanreports @@ -672,6 +678,9 @@ metadata: spec: group: kyverno.io names: + categories: + - kyverno + - all kind: ClusterAdmissionReport listKind: ClusterAdmissionReportList plural: clusteradmissionreports @@ -1014,6 +1023,9 @@ metadata: spec: group: kyverno.io names: + categories: + - kyverno + - all kind: ClusterBackgroundScanReport listKind: ClusterBackgroundScanReportList plural: clusterbackgroundscanreports @@ -1319,6 +1331,9 @@ metadata: spec: group: kyverno.io names: + categories: + - kyverno + - all kind: ClusterPolicy listKind: ClusterPolicyList plural: clusterpolicies @@ -1341,6 +1356,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v1 schema: openAPIV3Schema: @@ -7189,6 +7207,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v2beta1 schema: openAPIV3Schema: @@ -13330,6 +13351,9 @@ metadata: spec: group: kyverno.io names: + categories: + - kyverno + - all kind: Policy listKind: PolicyList plural: policies @@ -13352,6 +13376,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v1 schema: openAPIV3Schema: @@ -19202,6 +19229,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v2beta1 schema: openAPIV3Schema: @@ -25153,6 +25183,9 @@ metadata: spec: group: kyverno.io names: + categories: + - kyverno + - all kind: UpdateRequest listKind: UpdateRequestList plural: updaterequests diff --git a/config/install_debug.yaml b/config/install_debug.yaml index 861c212ac2..2e5b788140 100644 --- a/config/install_debug.yaml +++ b/config/install_debug.yaml @@ -24,6 +24,9 @@ metadata: spec: group: kyverno.io names: + categories: + - kyverno + - all kind: AdmissionReport listKind: AdmissionReportList plural: admissionreports @@ -364,6 +367,9 @@ metadata: spec: group: kyverno.io names: + categories: + - kyverno + - all kind: BackgroundScanReport listKind: BackgroundScanReportList plural: backgroundscanreports @@ -668,6 +674,9 @@ metadata: spec: group: kyverno.io names: + categories: + - kyverno + - all kind: ClusterAdmissionReport listKind: ClusterAdmissionReportList plural: clusteradmissionreports @@ -1009,6 +1018,9 @@ metadata: spec: group: kyverno.io names: + categories: + - kyverno + - all kind: ClusterBackgroundScanReport listKind: ClusterBackgroundScanReportList plural: clusterbackgroundscanreports @@ -1313,6 +1325,9 @@ metadata: spec: group: kyverno.io names: + categories: + - kyverno + - all kind: ClusterPolicy listKind: ClusterPolicyList plural: clusterpolicies @@ -1335,6 +1350,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v1 schema: openAPIV3Schema: @@ -7183,6 +7201,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v2beta1 schema: openAPIV3Schema: @@ -13321,6 +13342,9 @@ metadata: spec: group: kyverno.io names: + categories: + - kyverno + - all kind: Policy listKind: PolicyList plural: policies @@ -13343,6 +13367,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v1 schema: openAPIV3Schema: @@ -19193,6 +19220,9 @@ spec: - jsonPath: .status.ready name: Ready type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date name: v2beta1 schema: openAPIV3Schema: @@ -25142,6 +25172,9 @@ metadata: spec: group: kyverno.io names: + categories: + - kyverno + - all kind: UpdateRequest listKind: UpdateRequestList plural: updaterequests