Skip to content

Commit 3196738

Browse files
authored
Merge pull request #288 from hhyasdf/improve/print-network-cr-statistics
print statistics of Network CR
2 parents 479e437 + 13441ac commit 3196738

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

charts/hybridnet/crds/networking.alibaba.com_networks.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,30 @@ spec:
2626
- jsonPath: .spec.mode
2727
name: Mode
2828
type: string
29+
- jsonPath: .status.statistics.total
30+
name: V4Total
31+
type: integer
32+
- jsonPath: .status.statistics.used
33+
name: V4Used
34+
type: integer
35+
- jsonPath: .status.statistics.available
36+
name: V4Available
37+
type: integer
38+
- jsonPath: .status.lastAllocatedSubnet
39+
name: LastAllocatedV4Subnet
40+
type: string
41+
- jsonPath: .status.ipv6Statistics.total
42+
name: V6Total
43+
type: integer
44+
- jsonPath: .status.ipv6Statistics.used
45+
name: V6Used
46+
type: integer
47+
- jsonPath: .status.ipv6Statistics.available
48+
name: V6Available
49+
type: integer
50+
- jsonPath: .status.lastAllocatedIPv6Subnet
51+
name: LastAllocatedV6Subnet
52+
type: string
2953
name: v1
3054
schema:
3155
openAPIV3Schema:

pkg/apis/networking/v1/network_types.go

+8
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ type NetworkStatus struct {
6262
// +kubebuilder:printcolumn:name="NetID",type=integer,JSONPath=`.spec.netID`
6363
// +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.spec.type`
6464
// +kubebuilder:printcolumn:name="Mode",type=string,JSONPath=`.spec.mode`
65+
// +kubebuilder:printcolumn:name="V4Total",type=integer,JSONPath=`.status.statistics.total`
66+
// +kubebuilder:printcolumn:name="V4Used",type=integer,JSONPath=`.status.statistics.used`
67+
// +kubebuilder:printcolumn:name="V4Available",type=integer,JSONPath=`.status.statistics.available`
68+
// +kubebuilder:printcolumn:name="LastAllocatedV4Subnet",type=string,JSONPath=`.status.lastAllocatedSubnet`
69+
// +kubebuilder:printcolumn:name="V6Total",type=integer,JSONPath=`.status.ipv6Statistics.total`
70+
// +kubebuilder:printcolumn:name="V6Used",type=integer,JSONPath=`.status.ipv6Statistics.used`
71+
// +kubebuilder:printcolumn:name="V6Available",type=integer,JSONPath=`.status.ipv6Statistics.available`
72+
// +kubebuilder:printcolumn:name="LastAllocatedV6Subnet",type=string,JSONPath=`.status.lastAllocatedIPv6Subnet`
6573

6674
// Network is the Schema for the networks API
6775
type Network struct {

0 commit comments

Comments
 (0)