Skip to content

Commit 4bb8db0

Browse files
committed
Add additional printer columns
1 parent 99c6d21 commit 4bb8db0

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

kubernetes/crds/machine.sapcloud.io_machines.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,18 @@ spec:
1616
singular: machine
1717
scope: Namespaced
1818
versions:
19-
- name: v1alpha1
19+
- additionalPrinterColumns:
20+
- description: Current status of the machine.
21+
jsonPath: .status.currentStatus.phase
22+
name: Status
23+
type: string
24+
- description: |-
25+
CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.
26+
Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
27+
jsonPath: .metadata.creationTimestamp
28+
name: Age
29+
type: date
30+
name: v1alpha1
2031
schema:
2132
openAPIV3Schema:
2233
description: Machine is the representation of a physical or virtual machine.

pkg/apis/machine/v1alpha1/machine_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ import (
3131
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3232
// +kubebuilder:object:root=true
3333
// +kubebuilder:subresource:status
34+
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.currentStatus.phase`,description="Current status of the machine."
35+
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata"
3436

3537
// Machine is the representation of a physical or virtual machine.
3638
type Machine struct {

0 commit comments

Comments
 (0)