Skip to content

Commit

Permalink
Add support for kubectl printer columns (operator-framework#1421)
Browse files Browse the repository at this point in the history
Unless we add another `.status` field, this is what we can do.
Only simple queries starting with `.` can be used.

Signed-off-by: Todd Short <[email protected]>
  • Loading branch information
tmshort authored Nov 5, 2024
1 parent cfd4bec commit 6bda277
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions api/v1alpha1/clusterextension_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,11 @@ type ClusterExtensionInstallStatus struct {
//+kubebuilder:object:root=true
//+kubebuilder:resource:scope=Cluster
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Installed Bundle",type=string,JSONPath=`.status.install.bundle.name`
//+kubebuilder:printcolumn:name=Version,type=string,JSONPath=`.status.install.bundle.version`
//+kubebuilder:printcolumn:name="Installed",type=string,JSONPath=`.status.conditions[?(@.type=='Installed')].status`
//+kubebuilder:printcolumn:name="Progressing",type=string,JSONPath=`.status.conditions[?(@.type=='Progressing')].status`
//+kubebuilder:printcolumn:name=Age,type=date,JSONPath=`.metadata.creationTimestamp`

// ClusterExtension is the Schema for the clusterextensions API
type ClusterExtension struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,23 @@ spec:
singular: clusterextension
scope: Cluster
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .status.install.bundle.name
name: Installed Bundle
type: string
- jsonPath: .status.install.bundle.version
name: Version
type: string
- jsonPath: .status.conditions[?(@.type=='Installed')].status
name: Installed
type: string
- jsonPath: .status.conditions[?(@.type=='Progressing')].status
name: Progressing
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: ClusterExtension is the Schema for the clusterextensions API
Expand Down

0 comments on commit 6bda277

Please sign in to comment.