Skip to content

Commit 2fd9441

Browse files
committed
Add support for kubectl printer columns
Adds installed version, resolved version and age printer columns Signed-off-by: kevinrizza <[email protected]>
1 parent 235e3d4 commit 2fd9441

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

api/v1alpha1/clusterextension_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ type ClusterExtensionStatus struct {
183183
//+kubebuilder:object:root=true
184184
//+kubebuilder:resource:scope=Cluster
185185
//+kubebuilder:subresource:status
186+
//+kubebuilder:printcolumn:name="Installed Version",type=string,JSONPath=`.status.installedBundle.version`
187+
//+kubebuilder:printcolumn:name="Resolved Version",type=string,JSONPath=`.status.resolvedBundle.version`
188+
//+kubebuilder:printcolumn:name=Age,type=date,JSONPath=`.metadata.creationTimestamp`
186189

187190
// ClusterExtension is the Schema for the clusterextensions API
188191
type ClusterExtension struct {

config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,17 @@ spec:
1414
singular: clusterextension
1515
scope: Cluster
1616
versions:
17-
- name: v1alpha1
17+
- additionalPrinterColumns:
18+
- jsonPath: .status.installedBundle.version
19+
name: Installed Version
20+
type: string
21+
- jsonPath: .status.resolvedBundle.version
22+
name: Resolved Version
23+
type: string
24+
- jsonPath: .metadata.creationTimestamp
25+
name: Age
26+
type: date
27+
name: v1alpha1
1828
schema:
1929
openAPIV3Schema:
2030
description: ClusterExtension is the Schema for the clusterextensions API

0 commit comments

Comments
 (0)