Skip to content

Commit

Permalink
crd: add data engine in printer columns
Browse files Browse the repository at this point in the history
Longhorn 7095

Signed-off-by: Derek Su <derek.su@suse.com>
  • Loading branch information
derekbit authored and David Ko committed Dec 28, 2023
1 parent 64f4059 commit 93801ee
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
20 changes: 16 additions & 4 deletions k8s/crds.yaml
Expand Up @@ -1275,6 +1275,10 @@ spec:
subresources:
status: {}
- additionalPrinterColumns:
- description: The data engine of the engine
jsonPath: .spec.dataEngine
name: Data Engine
type: string
- description: The current state of the engine
jsonPath: .status.currentState
name: State
Expand Down Expand Up @@ -1628,6 +1632,10 @@ spec:
subresources:
status: {}
- additionalPrinterColumns:
- description: The data engine of the instance manager
jsonPath: .spec.dataEngine
name: Data Engine
type: string
- description: The state of the instance manager
jsonPath: .status.currentState
name: State
Expand All @@ -1636,10 +1644,6 @@ spec:
jsonPath: .spec.type
name: Type
type: string
- description: The data engine of the instance manager
jsonPath: .spec.dataEngine
name: Data Engine
type: string
- description: The node that the instance manager is running on
jsonPath: .spec.nodeID
name: Node
Expand Down Expand Up @@ -2407,6 +2411,10 @@ spec:
subresources:
status: {}
- additionalPrinterColumns:
- description: The data engine of the replica
jsonPath: .spec.dataEngine
name: Data Engine
type: string
- description: The current state of the replica
jsonPath: .status.currentState
name: State
Expand Down Expand Up @@ -3434,6 +3442,10 @@ spec:
subresources:
status: {}
- additionalPrinterColumns:
- description: The data engine of the volume
jsonPath: .spec.dataEngine
name: Data Engine
type: string
- description: The state of the volume
jsonPath: .status.state
name: State
Expand Down
1 change: 1 addition & 0 deletions k8s/pkg/apis/longhorn/v1beta2/engine.go
Expand Up @@ -191,6 +191,7 @@ type EngineStatus struct {
// +kubebuilder:resource:shortName=lhe
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Data Engine",type=string,JSONPath=`.spec.dataEngine`,description="The data engine of the engine"
// +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.currentState`,description="The current state of the engine"
// +kubebuilder:printcolumn:name="Node",type=string,JSONPath=`.spec.nodeID`,description="The node that the engine is on"
// +kubebuilder:printcolumn:name="InstanceManager",type=string,JSONPath=`.status.instanceManagerName`,description="The instance manager of the engine"
Expand Down
2 changes: 1 addition & 1 deletion k8s/pkg/apis/longhorn/v1beta2/instancemanager.go
Expand Up @@ -185,9 +185,9 @@ type InstanceManagerStatus struct {
// +kubebuilder:resource:shortName=lhim
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Data Engine",type=string,JSONPath=`.spec.dataEngine`,description="The data engine of the instance manager"
// +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.currentState`,description="The state of the instance manager"
// +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.spec.type`,description="The type of the instance manager (engine or replica)"
// +kubebuilder:printcolumn:name="Data Engine",type=string,JSONPath=`.spec.dataEngine`,description="The data engine of the instance manager"
// +kubebuilder:printcolumn:name="Node",type=string,JSONPath=`.spec.nodeID`,description="The node that the instance manager is running on"
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

Expand Down
1 change: 1 addition & 0 deletions k8s/pkg/apis/longhorn/v1beta2/replica.go
Expand Up @@ -63,6 +63,7 @@ type ReplicaStatus struct {
// +kubebuilder:resource:shortName=lhr
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Data Engine",type=string,JSONPath=`.spec.dataEngine`,description="The data engine of the replica"
// +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.currentState`,description="The current state of the replica"
// +kubebuilder:printcolumn:name="Node",type=string,JSONPath=`.spec.nodeID`,description="The node that the replica is on"
// +kubebuilder:printcolumn:name="Disk",type=string,JSONPath=`.spec.diskID`,description="The disk that the replica is on"
Expand Down
1 change: 1 addition & 0 deletions k8s/pkg/apis/longhorn/v1beta2/volume.go
Expand Up @@ -353,6 +353,7 @@ type VolumeStatus struct {
// +kubebuilder:resource:shortName=lhv
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Data Engine",type=string,JSONPath=`.spec.dataEngine`,description="The data engine of the volume"
// +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`,description="The state of the volume"
// +kubebuilder:printcolumn:name="Robustness",type=string,JSONPath=`.status.robustness`,description="The robustness of the volume"
// +kubebuilder:printcolumn:name="Scheduled",type=string,JSONPath=`.status.conditions[?(@.type=='Schedulable')].status`,description="The scheduled condition of the volume"
Expand Down

0 comments on commit 93801ee

Please sign in to comment.