Skip to content

Commit

Permalink
Merge pull request #288 from hhyasdf/improve/print-network-cr-statistics
Browse files Browse the repository at this point in the history
print statistics of Network CR
  • Loading branch information
hhyasdf authored Jul 1, 2022
2 parents 479e437 + 13441ac commit 3196738
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
24 changes: 24 additions & 0 deletions charts/hybridnet/crds/networking.alibaba.com_networks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,30 @@ spec:
- jsonPath: .spec.mode
name: Mode
type: string
- jsonPath: .status.statistics.total
name: V4Total
type: integer
- jsonPath: .status.statistics.used
name: V4Used
type: integer
- jsonPath: .status.statistics.available
name: V4Available
type: integer
- jsonPath: .status.lastAllocatedSubnet
name: LastAllocatedV4Subnet
type: string
- jsonPath: .status.ipv6Statistics.total
name: V6Total
type: integer
- jsonPath: .status.ipv6Statistics.used
name: V6Used
type: integer
- jsonPath: .status.ipv6Statistics.available
name: V6Available
type: integer
- jsonPath: .status.lastAllocatedIPv6Subnet
name: LastAllocatedV6Subnet
type: string
name: v1
schema:
openAPIV3Schema:
Expand Down
8 changes: 8 additions & 0 deletions pkg/apis/networking/v1/network_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ type NetworkStatus struct {
// +kubebuilder:printcolumn:name="NetID",type=integer,JSONPath=`.spec.netID`
// +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.spec.type`
// +kubebuilder:printcolumn:name="Mode",type=string,JSONPath=`.spec.mode`
// +kubebuilder:printcolumn:name="V4Total",type=integer,JSONPath=`.status.statistics.total`
// +kubebuilder:printcolumn:name="V4Used",type=integer,JSONPath=`.status.statistics.used`
// +kubebuilder:printcolumn:name="V4Available",type=integer,JSONPath=`.status.statistics.available`
// +kubebuilder:printcolumn:name="LastAllocatedV4Subnet",type=string,JSONPath=`.status.lastAllocatedSubnet`
// +kubebuilder:printcolumn:name="V6Total",type=integer,JSONPath=`.status.ipv6Statistics.total`
// +kubebuilder:printcolumn:name="V6Used",type=integer,JSONPath=`.status.ipv6Statistics.used`
// +kubebuilder:printcolumn:name="V6Available",type=integer,JSONPath=`.status.ipv6Statistics.available`
// +kubebuilder:printcolumn:name="LastAllocatedV6Subnet",type=string,JSONPath=`.status.lastAllocatedIPv6Subnet`

// Network is the Schema for the networks API
type Network struct {
Expand Down

0 comments on commit 3196738

Please sign in to comment.