Skip to content

Commit cb77fdc

Browse files
committed
additional print columns for CRDs: ResourceInterpreterCustomization ClusterPropagationPolicy and PropagationPolicy
Signed-off-by: Amir Alavi <[email protected]>
1 parent 8e54677 commit cb77fdc

File tree

5 files changed

+39
-3
lines changed

5 files changed

+39
-3
lines changed

charts/karmada/_crds/bases/config/config.karmada.io_resourceinterpretercustomizations.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ spec:
1818
singular: resourceinterpretercustomization
1919
scope: Cluster
2020
versions:
21-
- name: v1alpha1
21+
- additionalPrinterColumns:
22+
- jsonPath: .spec.target.apiVersion
23+
name: TARGET-API-VERSION
24+
priority: 1
25+
type: string
26+
- jsonPath: .spec.target.kind
27+
name: TARGET-KIND
28+
priority: 1
29+
type: string
30+
name: v1alpha1
2231
schema:
2332
openAPIV3Schema:
2433
description: |-
@@ -372,3 +381,4 @@ spec:
372381
type: object
373382
served: true
374383
storage: true
384+
subresources: {}

charts/karmada/_crds/bases/policy/policy.karmada.io_clusterpropagationpolicies.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ spec:
1818
singular: clusterpropagationpolicy
1919
scope: Cluster
2020
versions:
21-
- name: v1alpha1
21+
- additionalPrinterColumns:
22+
- jsonPath: .spec.conflictResolution
23+
name: CONFLICT-RESOLUTION
24+
priority: 1
25+
type: string
26+
- jsonPath: .spec.priority
27+
name: PRIORITY
28+
priority: 1
29+
type: string
30+
name: v1alpha1
2231
schema:
2332
openAPIV3Schema:
2433
description: |-
@@ -793,3 +802,4 @@ spec:
793802
type: object
794803
served: true
795804
storage: true
805+
subresources: {}

charts/karmada/_crds/bases/policy/policy.karmada.io_propagationpolicies.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ spec:
1818
singular: propagationpolicy
1919
scope: Namespaced
2020
versions:
21-
- name: v1alpha1
21+
- additionalPrinterColumns:
22+
- jsonPath: .spec.conflictResolution
23+
name: CONFLICT-RESOLUTION
24+
priority: 1
25+
type: string
26+
- jsonPath: .spec.priority
27+
name: PRIORITY
28+
priority: 1
29+
type: string
30+
name: v1alpha1
2231
schema:
2332
openAPIV3Schema:
2433
description: PropagationPolicy represents the policy that propagates a group
@@ -790,3 +799,4 @@ spec:
790799
type: object
791800
served: true
792801
storage: true
802+
subresources: {}

pkg/apis/config/v1alpha1/resourceinterpretercustomization_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ const (
3636
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3737
// +kubebuilder:resource:path=resourceinterpretercustomizations,scope="Cluster",shortName=ric,categories={karmada-io}
3838
// +kubebuilder:storageversion
39+
// +kubebuilder:printcolumn:JSONPath=`.spec.target.apiVersion`,name="TARGET-API-VERSION",type=string,priority=1
40+
// +kubebuilder:printcolumn:JSONPath=`.spec.target.kind`,name="TARGET-KIND",type=string,priority=1
3941

4042
// ResourceInterpreterCustomization describes the configuration of a specific
4143
// resource for Karmada to get the structure.

pkg/apis/policy/v1alpha1/propagation_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ const (
4444
// +genclient
4545
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4646
// +kubebuilder:resource:path=propagationpolicies,scope=Namespaced,shortName=pp,categories={karmada-io}
47+
// +kubebuilder:printcolumn:JSONPath=`.spec.conflictResolution`,name="CONFLICT-RESOLUTION",type=string,priority=1
48+
// +kubebuilder:printcolumn:JSONPath=`.spec.priority`,name="PRIORITY",type=string,priority=1
4749

4850
// PropagationPolicy represents the policy that propagates a group of resources to one or more clusters.
4951
type PropagationPolicy struct {
@@ -562,6 +564,8 @@ type PropagationPolicyList struct {
562564
// +genclient:nonNamespaced
563565
// +kubebuilder:resource:path=clusterpropagationpolicies,scope="Cluster",shortName=cpp,categories={karmada-io}
564566
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
567+
// +kubebuilder:printcolumn:JSONPath=`.spec.conflictResolution`,name="CONFLICT-RESOLUTION",type=string,priority=1
568+
// +kubebuilder:printcolumn:JSONPath=`.spec.priority`,name="PRIORITY",type=string,priority=1
565569

566570
// ClusterPropagationPolicy represents the cluster-wide policy that propagates a group of resources to one or more clusters.
567571
// Different with PropagationPolicy that could only propagate resources in its own namespace, ClusterPropagationPolicy

0 commit comments

Comments
 (0)