From 60da0d7f804efdbe374aefa6c43bd991e069b87b Mon Sep 17 00:00:00 2001 From: sratslla Date: Tue, 12 Mar 2024 16:13:04 +0530 Subject: [PATCH] feat: Added column in ksp and hsp -owide Signed-off-by: sratslla --- deployments/CRD/KubeArmorHostPolicy.yaml | 14 +++++++++++++- deployments/CRD/KubeArmorPolicy.yaml | 14 +++++++++++++- .../v1/kubearmorhostpolicy_types.go | 3 +++ .../v1/kubearmorpolicy_types.go | 3 +++ ...rity.kubearmor.com_kubearmorhostpolicies.yaml | 16 ++++++++++++++-- ...security.kubearmor.com_kubearmorpolicies.yaml | 16 ++++++++++++++-- .../crd/KubeArmorHostPolicy.yaml | 14 +++++++++++++- pkg/KubeArmorController/crd/KubeArmorPolicy.yaml | 16 ++++++++++++++-- 8 files changed, 87 insertions(+), 9 deletions(-) diff --git a/deployments/CRD/KubeArmorHostPolicy.yaml b/deployments/CRD/KubeArmorHostPolicy.yaml index af92ce46d4..497c216ff7 100644 --- a/deployments/CRD/KubeArmorHostPolicy.yaml +++ b/deployments/CRD/KubeArmorHostPolicy.yaml @@ -18,7 +18,19 @@ spec: singular: kubearmorhostpolicy scope: Cluster versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .spec.action + name: Action + priority: 10 + type: string + - jsonPath: .spec.nodeSelector.matchLabels + name: Selector + priority: 10 + type: string + name: v1 schema: openAPIV3Schema: description: KubeArmorHostPolicy is the Schema for the kubearmorhostpolicies diff --git a/deployments/CRD/KubeArmorPolicy.yaml b/deployments/CRD/KubeArmorPolicy.yaml index 9755fe5449..ce3ef593fa 100644 --- a/deployments/CRD/KubeArmorPolicy.yaml +++ b/deployments/CRD/KubeArmorPolicy.yaml @@ -18,7 +18,19 @@ spec: singular: kubearmorpolicy scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .spec.action + name: Action + priority: 10 + type: string + - jsonPath: .spec.selector.matchLabels + name: Selector + priority: 10 + type: string + name: v1 schema: openAPIV3Schema: description: KubeArmorPolicy is the Schema for the kubearmorpolicies API diff --git a/pkg/KubeArmorController/api/security.kubearmor.com/v1/kubearmorhostpolicy_types.go b/pkg/KubeArmorController/api/security.kubearmor.com/v1/kubearmorhostpolicy_types.go index d5a516ce75..3f596de68b 100644 --- a/pkg/KubeArmorController/api/security.kubearmor.com/v1/kubearmorhostpolicy_types.go +++ b/pkg/KubeArmorController/api/security.kubearmor.com/v1/kubearmorhostpolicy_types.go @@ -41,6 +41,9 @@ type KubeArmorHostPolicyStatus struct { // +genclient:nonNamespaced // +kubebuilder:resource:scope=Cluster,shortName=hsp // +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +// +kubebuilder:printcolumn:name="Action",type=string,JSONPath=`.spec.action`,priority=10 +// +kubebuilder:printcolumn:name="Selector",type=string,JSONPath=`.spec.nodeSelector.matchLabels`,priority=10 type KubeArmorHostPolicy struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/pkg/KubeArmorController/api/security.kubearmor.com/v1/kubearmorpolicy_types.go b/pkg/KubeArmorController/api/security.kubearmor.com/v1/kubearmorpolicy_types.go index 6fc4617575..d9c1fb1526 100644 --- a/pkg/KubeArmorController/api/security.kubearmor.com/v1/kubearmorpolicy_types.go +++ b/pkg/KubeArmorController/api/security.kubearmor.com/v1/kubearmorpolicy_types.go @@ -75,6 +75,9 @@ type KubeArmorPolicyStatus struct { // +genclient // +kubebuilder:resource:shortName=ksp // +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +// +kubebuilder:printcolumn:name="Action",type=string,JSONPath=`.spec.action`,priority=10 +// +kubebuilder:printcolumn:name="Selector",type=string,JSONPath=`.spec.selector.matchLabels`,priority=10 type KubeArmorPolicy struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/pkg/KubeArmorController/config/crd/bases/security.kubearmor.com_kubearmorhostpolicies.yaml b/pkg/KubeArmorController/config/crd/bases/security.kubearmor.com_kubearmorhostpolicies.yaml index 9f5630174a..497c216ff7 100644 --- a/pkg/KubeArmorController/config/crd/bases/security.kubearmor.com_kubearmorhostpolicies.yaml +++ b/pkg/KubeArmorController/config/crd/bases/security.kubearmor.com_kubearmorhostpolicies.yaml @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.14.0 + controller-gen.kubebuilder.io/version: v0.4.1 creationTimestamp: null name: kubearmorhostpolicies.security.kubearmor.com spec: @@ -18,7 +18,19 @@ spec: singular: kubearmorhostpolicy scope: Cluster versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .spec.action + name: Action + priority: 10 + type: string + - jsonPath: .spec.nodeSelector.matchLabels + name: Selector + priority: 10 + type: string + name: v1 schema: openAPIV3Schema: description: KubeArmorHostPolicy is the Schema for the kubearmorhostpolicies diff --git a/pkg/KubeArmorController/config/crd/bases/security.kubearmor.com_kubearmorpolicies.yaml b/pkg/KubeArmorController/config/crd/bases/security.kubearmor.com_kubearmorpolicies.yaml index 5349187f36..ce3ef593fa 100644 --- a/pkg/KubeArmorController/config/crd/bases/security.kubearmor.com_kubearmorpolicies.yaml +++ b/pkg/KubeArmorController/config/crd/bases/security.kubearmor.com_kubearmorpolicies.yaml @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.14.0 + controller-gen.kubebuilder.io/version: v0.4.1 creationTimestamp: null name: kubearmorpolicies.security.kubearmor.com spec: @@ -18,7 +18,19 @@ spec: singular: kubearmorpolicy scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .spec.action + name: Action + priority: 10 + type: string + - jsonPath: .spec.selector.matchLabels + name: Selector + priority: 10 + type: string + name: v1 schema: openAPIV3Schema: description: KubeArmorPolicy is the Schema for the kubearmorpolicies API diff --git a/pkg/KubeArmorController/crd/KubeArmorHostPolicy.yaml b/pkg/KubeArmorController/crd/KubeArmorHostPolicy.yaml index af92ce46d4..497c216ff7 100644 --- a/pkg/KubeArmorController/crd/KubeArmorHostPolicy.yaml +++ b/pkg/KubeArmorController/crd/KubeArmorHostPolicy.yaml @@ -18,7 +18,19 @@ spec: singular: kubearmorhostpolicy scope: Cluster versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .spec.action + name: Action + priority: 10 + type: string + - jsonPath: .spec.nodeSelector.matchLabels + name: Selector + priority: 10 + type: string + name: v1 schema: openAPIV3Schema: description: KubeArmorHostPolicy is the Schema for the kubearmorhostpolicies diff --git a/pkg/KubeArmorController/crd/KubeArmorPolicy.yaml b/pkg/KubeArmorController/crd/KubeArmorPolicy.yaml index 5349187f36..ce3ef593fa 100644 --- a/pkg/KubeArmorController/crd/KubeArmorPolicy.yaml +++ b/pkg/KubeArmorController/crd/KubeArmorPolicy.yaml @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.14.0 + controller-gen.kubebuilder.io/version: v0.4.1 creationTimestamp: null name: kubearmorpolicies.security.kubearmor.com spec: @@ -18,7 +18,19 @@ spec: singular: kubearmorpolicy scope: Namespaced versions: - - name: v1 + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .spec.action + name: Action + priority: 10 + type: string + - jsonPath: .spec.selector.matchLabels + name: Selector + priority: 10 + type: string + name: v1 schema: openAPIV3Schema: description: KubeArmorPolicy is the Schema for the kubearmorpolicies API