Skip to content

Commit

Permalink
Define additional printer columns
Browse files Browse the repository at this point in the history
  • Loading branch information
dee-kryvenko committed Jan 20, 2025
1 parent 83474a2 commit d283e95
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions api/autoscaler/v1alpha1/poll_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ type PollStatus struct {

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Available",type="string",JSONPath=".status.conditions[?(@.type=='Available')].status",description="Current status based on Available condition"
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status",description="Current status based on Ready condition"
// +kubebuilder:printcolumn:name="Last Polled",type="date",JSONPath=".status.lastPollingTime",description="Since last poll"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time since creation"

// Poll is the Schema for the polls API.
type Poll struct {
Expand Down
19 changes: 18 additions & 1 deletion config/crd/bases/autoscaler.argoproj.iom_polls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,24 @@ spec:
singular: poll
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: Current status based on Available condition
jsonPath: .status.conditions[?(@.type=='Available')].status
name: Available
type: string
- description: Current status based on Ready condition
jsonPath: .status.conditions[?(@.type=='Ready')].status
name: Ready
type: string
- description: Since last poll
jsonPath: .status.lastPollingTime
name: Last Polled
type: date
- description: Time since creation
jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: Poll is the Schema for the polls API.
Expand Down

0 comments on commit d283e95

Please sign in to comment.