Skip to content

Commit

Permalink
Merge pull request #262 from lxiaopei/topic/lxiaopei/update_vpc
Browse files Browse the repository at this point in the history
Add LBSubnetPath under VPC status
  • Loading branch information
lxiaopei committed Aug 10, 2023
2 parents d4be8a7 + 5d3af30 commit 539d839
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 95 deletions.
60 changes: 16 additions & 44 deletions build/yaml/crd/nsx.vmware.com_vpcs.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -38,48 +39,6 @@ spec:
status:
description: VPCStatus defines the observed state of VPC
properties:
cidrsUsage:
properties:
privateCIDRsUsage:
properties:
allocated:
description: Allocated IPs in the IP Block (including IPs
used by other VPCs).
type: integer
total:
description: Total IP number in the IP Block.
type: integer
used:
description: Used IP for the VPC in the IP Block (IPs used
only in current VPC).
type: integer
required:
- allocated
- total
- used
type: object
publicCIDRsUsage:
properties:
allocated:
description: Allocated IPs in the IP Block (including IPs
used by other VPCs).
type: integer
total:
description: Total IP number in the IP Block.
type: integer
used:
description: Used IP for the VPC in the IP Block (IPs used
only in current VPC).
type: integer
required:
- allocated
- total
- used
type: object
required:
- privateCIDRsUsage
- publicCIDRsUsage
type: object
conditions:
items:
description: Condition defines condition of custom resource.
Expand Down Expand Up @@ -109,19 +68,32 @@ spec:
type: object
type: array
defaultSNATIP:
description: Default SNAT IP for private Subnets
description: Default SNAT IP for private Subnets.
type: string
lbSubnetCIDR:
description: CIDR for the load balancer Subnet.
type: string
lbSubnetPath:
description: NSX PolicyPath for the load balancer Subnet.
type: string
nsxResourcePath:
description: NSX VPC Policy API resource path.
type: string
required:
- cidrsUsage
- conditions
- defaultSNATIP
- lbSubnetCIDR
- lbSubnetPath
- nsxResourcePath
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
25 changes: 7 additions & 18 deletions pkg/apis/v1alpha1/vpc_types.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2022 VMware, Inc. All Rights Reserved.
/* Copyright © 2022 VMware, Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0 */

package v1alpha1
Expand Down Expand Up @@ -38,23 +38,12 @@ type VPCStatus struct {
Conditions []Condition `json:"conditions"`
// NSX VPC Policy API resource path.
NSXResourcePath string `json:"nsxResourcePath"`
// Default SNAT IP for private Subnets
DefaultSNATIP string `json:"defaultSNATIP"`
CIDRsUsage VPCCIDRsUsageInfo `json:"cidrsUsage"`
}

type VPCCIDRsUsageInfo struct {
PublicCIDRsUsage CIDRsUsageInfo `json:"publicCIDRsUsage"`
PrivateCIDRsUsage CIDRsUsageInfo `json:"privateCIDRsUsage"`
}

type CIDRsUsageInfo struct {
// Allocated IPs in the IP Block (including IPs used by other VPCs).
Allocated int `json:"allocated"`
// Used IP for the VPC in the IP Block (IPs used only in current VPC).
Used int `json:"used"`
// Total IP number in the IP Block.
Total int `json:"total"`
// Default SNAT IP for private Subnets.
DefaultSNATIP string `json:"defaultSNATIP"`
// NSX PolicyPath for the load balancer Subnet.
LBSubnetPath string `json:"lbSubnetPath"`
// CIDR for the load balancer Subnet.
LBSubnetCIDR string `json:"lbSubnetCIDR"`
}

func init() {
Expand Down
33 changes: 0 additions & 33 deletions pkg/apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 539d839

Please sign in to comment.