Add better kubectl columns to ImageUpdateAutomation

Signed-off-by: lukas8219 <lucas.c4d@gmail.com>
This commit is contained in:
lukas8219 2025-06-27 12:49:33 -03:00
parent b3b47761c6
commit ad9486eb8d
No known key found for this signature in database
GPG Key ID: 2DAC1FAFACECB66F
2 changed files with 14 additions and 1 deletions

View File

@ -132,8 +132,11 @@ type ObservedPolicies map[string]ImageRef
//+kubebuilder:storageversion //+kubebuilder:storageversion
//+kubebuilder:object:root=true //+kubebuilder:object:root=true
//+kubebuilder:subresource:status //+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Last run",type=string,JSONPath=`.status.lastAutomationRunTime`
//+kubebuilder:resource:shortName=iua;imgupd;imgauto //+kubebuilder:resource:shortName=iua;imgupd;imgauto
//+kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description=""
//+kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description=""
//+kubebuilder:printcolumn:name="Last run",type="string",JSONPath=".status.lastAutomationRunTime",priority=1
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description=""
// ImageUpdateAutomation is the Schema for the imageupdateautomations API // ImageUpdateAutomation is the Schema for the imageupdateautomations API
type ImageUpdateAutomation struct { type ImageUpdateAutomation struct {

View File

@ -332,9 +332,19 @@ spec:
subresources: subresources:
status: {} status: {}
- additionalPrinterColumns: - additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=="Ready")].status
name: Ready
type: string
- jsonPath: .status.conditions[?(@.type=="Ready")].message
name: Status
type: string
- jsonPath: .status.lastAutomationRunTime - jsonPath: .status.lastAutomationRunTime
name: Last run name: Last run
priority: 1
type: string type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta2 name: v1beta2
schema: schema:
openAPIV3Schema: openAPIV3Schema: