From fd7139daa0a8d502cf2093c6f3c4f62324a0210e Mon Sep 17 00:00:00 2001 From: lonelyCZ Date: Thu, 7 Dec 2023 11:04:34 +0800 Subject: [PATCH] Add additionalPrinterColumns Kind for Work CRD Signed-off-by: lonelyCZ --- charts/karmada/_crds/bases/work/work.karmada.io_works.yaml | 3 +++ pkg/apis/work/v1alpha1/work_types.go | 1 + 2 files changed, 4 insertions(+) diff --git a/charts/karmada/_crds/bases/work/work.karmada.io_works.yaml b/charts/karmada/_crds/bases/work/work.karmada.io_works.yaml index 8c5f7f68de09..64d9f93c4c22 100644 --- a/charts/karmada/_crds/bases/work/work.karmada.io_works.yaml +++ b/charts/karmada/_crds/bases/work/work.karmada.io_works.yaml @@ -20,6 +20,9 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: + - jsonPath: .spec.workload.manifests[*].kind + name: Workload-Kind + type: string - jsonPath: .status.conditions[?(@.type=="Applied")].status name: Applied type: string diff --git a/pkg/apis/work/v1alpha1/work_types.go b/pkg/apis/work/v1alpha1/work_types.go index 98ead29d2060..e90695a7e356 100644 --- a/pkg/apis/work/v1alpha1/work_types.go +++ b/pkg/apis/work/v1alpha1/work_types.go @@ -36,6 +36,7 @@ const ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:subresource:status // +kubebuilder:resource:categories={karmada-io},shortName=wk +// +kubebuilder:printcolumn:JSONPath=`.spec.workload.manifests[*].kind`,name="Workload-Kind",type=string // +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Applied")].status`,name="Applied",type=string // +kubebuilder:printcolumn:JSONPath=`.metadata.creationTimestamp`,name="Age",type=date