Skip to content

Commit

Permalink
Merge pull request #385 from Abirdcfly/main
Browse files Browse the repository at this point in the history
feat: add printcolumn for cpl and sub
  • Loading branch information
nkwangleiGIT authored Oct 27, 2023
2 parents 2b04f6a + f11a63b commit 6796675
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions api/v1alpha1/componentplan_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ type Resource struct {
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Namespaced,shortName=cpl;cpls
//+kubebuilder:printcolumn:name="cpl-name",type=string,JSONPath=`.spec.name`
//+kubebuilder:printcolumn:name="cp-name",type=string,JSONPath=`.spec.component.name`

// ComponentPlan is the Schema for the componentplans API
type ComponentPlan struct {
Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha1/subscription_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ type RepositoryHealth struct {
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Namespaced,shortName=sub;subs
//+kubebuilder:printcolumn:name="sub-name",type=string,JSONPath=`.spec.name`
//+kubebuilder:printcolumn:name="cp-name",type=string,JSONPath=`.spec.component.name`

// Subscription is the Schema for the subscriptions API
type Subscription struct {
Expand Down
1 change: 1 addition & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion config/crd/bases/core.kubebb.k8s.com.cn_componentplans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ spec:
singular: componentplan
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .spec.name
name: cpl-name
type: string
- jsonPath: .spec.component.name
name: cp-name
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: ComponentPlan is the Schema for the componentplans API
Expand Down
9 changes: 8 additions & 1 deletion config/crd/bases/core.kubebb.k8s.com.cn_subscriptions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ spec:
singular: subscription
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .spec.name
name: sub-name
type: string
- jsonPath: .spec.component.name
name: cp-name
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: Subscription is the Schema for the subscriptions API
Expand Down

0 comments on commit 6796675

Please sign in to comment.