Skip to content

Commit 808466d

Browse files
committed
update printcolumn
1 parent a353841 commit 808466d

File tree

4 files changed

+42
-13
lines changed

4 files changed

+42
-13
lines changed

api/v1beta1/proxmoxcluster_types.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ type ProxmoxClusterStatus struct {
5959

6060
//+kubebuilder:object:root=true
6161
//+kubebuilder:subresource:status
62-
// +kubebuilder:printcolumn:name="ControlPlaneEndpoint",type=string,JSONPath=`.spec.controlPlaneEndpoint.host`
63-
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.ready`
62+
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Cluster infrastructure is ready for ProxmoxMachine"
63+
// +kubebuilder:printcolumn:name="Proxmox-Server",type="string",JSONPath=".spec.serverRef.endpoint",description="Server is the address of the Proxmox API endpoint."
64+
// +kubebuilder:printcolumn:name="ControlPlane",type="string",JSONPath=".spec.controlPlaneEndpoint.host",description="kube-apiserver Endpoint"
65+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Machine"
6466

6567
// ProxmoxCluster is the Schema for the proxmoxclusters API
6668
type ProxmoxCluster struct {

api/v1beta1/proxmoxmachine_types.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ type ProxmoxMachineStatus struct {
7878
// FailureMessage
7979
FailureMessage *string `json:"failureMessage,omitempty"`
8080

81-
// Addresses contains the AWS instance associated addresses.
81+
// Addresses
8282
Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"`
8383

8484
// Conditions
@@ -91,9 +91,12 @@ type ProxmoxMachineStatus struct {
9191

9292
//+kubebuilder:object:root=true
9393
//+kubebuilder:subresource:status
94-
// +kubebuilder:printcolumn:name="Addresses",type=string,JSONPath=`.status.addresses`
94+
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this VSphereMachine belongs"
95+
// +kubebuilder:printcolumn:name="Machine",type="string",JSONPath=".metadata.ownerReferences[?(@.kind==\"Machine\")].name",description="Machine object which owns with this ProxmoxMachine",priority=1
96+
// +kubebuilder:printcolumn:name="vmid",type=string,JSONPath=`.spec.vmID`,priority=1
9597
// +kubebuilder:printcolumn:name="ProviderID",type=string,JSONPath=`.spec.providerID`
96-
// +kubebuilder:printcolumn:name="InstanceStatus",type=string,JSONPath=`.status.instanceStatus`
98+
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.instanceStatus`
99+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Machine"
97100

98101
// ProxmoxMachine is the Schema for the proxmoxmachines API
99102
type ProxmoxMachine struct {

config/crd/bases/infrastructure.cluster.x-k8s.io_proxmoxclusters.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,22 @@ spec:
1616
scope: Namespaced
1717
versions:
1818
- additionalPrinterColumns:
19-
- jsonPath: .spec.controlPlaneEndpoint.host
20-
name: ControlPlaneEndpoint
21-
type: string
22-
- jsonPath: .status.ready
19+
- description: Cluster infrastructure is ready for ProxmoxMachine
20+
jsonPath: .status.ready
2321
name: Ready
2422
type: string
23+
- description: Server is the address of the Proxmox API endpoint.
24+
jsonPath: .spec.serverRef.endpoint
25+
name: Proxmox-Server
26+
type: string
27+
- description: kube-apiserver Endpoint
28+
jsonPath: .spec.controlPlaneEndpoint.host
29+
name: ControlPlane
30+
type: string
31+
- description: Time duration since creation of Machine
32+
jsonPath: .metadata.creationTimestamp
33+
name: Age
34+
type: date
2535
name: v1beta1
2636
schema:
2737
openAPIV3Schema:

config/crd/bases/infrastructure.cluster.x-k8s.io_proxmoxmachines.yaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,29 @@ spec:
1616
scope: Namespaced
1717
versions:
1818
- additionalPrinterColumns:
19-
- jsonPath: .status.addresses
20-
name: Addresses
19+
- description: Cluster to which this VSphereMachine belongs
20+
jsonPath: .metadata.labels.cluster\.x-k8s\.io/cluster-name
21+
name: Cluster
22+
type: string
23+
- description: Machine object which owns with this ProxmoxMachine
24+
jsonPath: .metadata.ownerReferences[?(@.kind=="Machine")].name
25+
name: Machine
26+
priority: 1
27+
type: string
28+
- jsonPath: .spec.vmID
29+
name: vmid
30+
priority: 1
2131
type: string
2232
- jsonPath: .spec.providerID
2333
name: ProviderID
2434
type: string
2535
- jsonPath: .status.instanceStatus
26-
name: InstanceStatus
36+
name: Status
2737
type: string
38+
- description: Time duration since creation of Machine
39+
jsonPath: .metadata.creationTimestamp
40+
name: Age
41+
type: date
2842
name: v1beta1
2943
schema:
3044
openAPIV3Schema:
@@ -135,7 +149,7 @@ spec:
135149
description: ProxmoxMachineStatus defines the observed state of ProxmoxMachine
136150
properties:
137151
addresses:
138-
description: Addresses contains the AWS instance associated addresses.
152+
description: Addresses
139153
items:
140154
description: MachineAddress contains information for the node's
141155
address.

0 commit comments

Comments
 (0)