Skip to content

Commit fd9f308

Browse files
authored
Add age column and fix column order (#81)
A few UX changes: Adds an age column (with Kubebuilder this disappears from the CRD as soon as you add the first printcolumn) Orders the condition columns to feature the "Ready" condition as the last one
1 parent d3d6f7e commit fd9f308

File tree

8 files changed

+24
-8
lines changed

8 files changed

+24
-8
lines changed

api/v1/ipaddress_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ type IpAddressStatus struct {
6363
//+kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`
6464
//+kubebuilder:printcolumn:name="ID",type=string,JSONPath=`.status.id`
6565
//+kubebuilder:printcolumn:name="URL",type=string,JSONPath=`.status.url`
66+
//+kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
6667
// +kubebuilder:resource:shortName=ip
6768

6869
// IpAddress is the Schema for the ipaddresses API

api/v1/ipaddressclaim_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ type IpAddressClaimStatus struct {
6363
//+kubebuilder:subresource:status
6464
//+kubebuilder:storageversion
6565
//+kubebuilder:printcolumn:name="IpAddress",type=string,JSONPath=`.status.ipAddress`
66-
//+kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`
6766
//+kubebuilder:printcolumn:name="IpAssigned",type=string,JSONPath=`.status.conditions[?(@.type=="IPAssigned")].status`
67+
//+kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`
68+
//+kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
6869
// +kubebuilder:resource:shortName=ipc
6970

7071
// IpAddressClaim is the Schema for the ipaddressclaims API

api/v1/prefix_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ type PrefixStatus struct {
6565
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`
6666
// +kubebuilder:printcolumn:name="ID",type=string,JSONPath=`.status.id`
6767
// +kubebuilder:printcolumn:name="URL",type=string,JSONPath=`.status.url`
68+
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
6869
// +kubebuilder:resource:shortName=px
6970
// Prefix is the Schema for the prefixes API
7071
type Prefix struct {

api/v1/prefixclaim_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ type PrefixClaimStatus struct {
6565
// +kubebuilder:object:root=true
6666
// +kubebuilder:subresource:status
6767
// +kubebuilder:printcolumn:name="Prefix",type=string,JSONPath=`.status.prefix`
68-
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`
6968
// +kubebuilder:printcolumn:name="PrefixAssigned",type=string,JSONPath=`.status.conditions[?(@.type=="PrefixAssigned")].status`
69+
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`
70+
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
7071
// +kubebuilder:resource:shortName=pxc
7172
// PrefixClaim is the Schema for the prefixclaims API
7273
type PrefixClaim struct {

config/crd/bases/netbox.dev_ipaddressclaims.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ spec:
2020
- jsonPath: .status.ipAddress
2121
name: IpAddress
2222
type: string
23-
- jsonPath: .status.conditions[?(@.type=="Ready")].status
24-
name: Ready
25-
type: string
2623
- jsonPath: .status.conditions[?(@.type=="IPAssigned")].status
2724
name: IpAssigned
2825
type: string
26+
- jsonPath: .status.conditions[?(@.type=="Ready")].status
27+
name: Ready
28+
type: string
29+
- jsonPath: .metadata.creationTimestamp
30+
name: Age
31+
type: date
2932
name: v1
3033
schema:
3134
openAPIV3Schema:

config/crd/bases/netbox.dev_ipaddresses.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ spec:
2929
- jsonPath: .status.url
3030
name: URL
3131
type: string
32+
- jsonPath: .metadata.creationTimestamp
33+
name: Age
34+
type: date
3235
name: v1
3336
schema:
3437
openAPIV3Schema:

config/crd/bases/netbox.dev_prefixclaims.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ spec:
2020
- jsonPath: .status.prefix
2121
name: Prefix
2222
type: string
23-
- jsonPath: .status.conditions[?(@.type=="Ready")].status
24-
name: Ready
25-
type: string
2623
- jsonPath: .status.conditions[?(@.type=="PrefixAssigned")].status
2724
name: PrefixAssigned
2825
type: string
26+
- jsonPath: .status.conditions[?(@.type=="Ready")].status
27+
name: Ready
28+
type: string
29+
- jsonPath: .metadata.creationTimestamp
30+
name: Age
31+
type: date
2932
name: v1
3033
schema:
3134
openAPIV3Schema:

config/crd/bases/netbox.dev_prefixes.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ spec:
2929
- jsonPath: .status.url
3030
name: URL
3131
type: string
32+
- jsonPath: .metadata.creationTimestamp
33+
name: Age
34+
type: date
3235
name: v1
3336
schema:
3437
openAPIV3Schema:

0 commit comments

Comments
 (0)