Skip to content

Commit

Permalink
Merge pull request #399 from timdengyun/vpc_dev_rebase_to_main_21_Nov
Browse files Browse the repository at this point in the history
vpc_dev branch rebase to main branch
  • Loading branch information
timdengyun committed Nov 24, 2023
2 parents 0e2f90a + 93699bb commit 0a01661
Show file tree
Hide file tree
Showing 244 changed files with 22,880 additions and 674 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ help: ## Display this help.

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=build/yaml/crd/
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="github.com/vmware-tanzu/nsx-operator/pkg/apis/v1alpha1;github.com/vmware-tanzu/nsx-operator/pkg/apis/v1alpha2" output:crd:artifacts:config=build/yaml/crd/

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand All @@ -56,14 +56,18 @@ vet: ## Run go vet against code.

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test -gcflags=all=-l ./... -coverprofile cover.out ## Prohibit inline optimization when using gomonkey

##@ Build

.PHONY: build
build: generate fmt vet ## Build manager binary.
go build -o bin/manager cmd/main.go

.PHONY: clean
clean: generate fmt vet ## Build clean binary.
go build -o bin/clean cmd_clean/main.go

.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
go run ./cmd/main.go
Expand Down Expand Up @@ -113,6 +117,9 @@ KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.8.7)

generated:
./hack/update-codegen.sh

ENVTEST = $(shell pwd)/bin/setup-envtest
.PHONY: envtest
envtest: ## Download envtest-setup locally if necessary.
Expand Down
7 changes: 7 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,11 @@ resources:
kind: NSXServiceAccount
path: github.com/vmware-tanzu/nsx-operator/pkg/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: nsx.vmware.com
kind: IPPool
path: github.com/vmware-tanzu/nsx-operator/pkg/api/v1alpha2
version: v1alpha2
version: "3"
116 changes: 98 additions & 18 deletions build/yaml/crd/nsx.vmware.com_ippools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
controller-gen.kubebuilder.io/version: v0.11.0
creationTimestamp: null
name: ippools.nsx.vmware.com
spec:
Expand All @@ -18,31 +18,120 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: IPPool is the Schema for the ippools API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: IPPoolSpec defines the desired state of IPPool.
properties:
subnets:
description: Subnets defines set of subnets need to be allocated.
items:
description: SubnetRequest defines the subnet allocation request.
properties:
ipFamily:
pattern: ^ipv(4|6)$
default: IPv4
description: IPFamily defines the IP family type for this subnet,
could be IPv4 or IPv6. This is optional, the default is IPv4.
enum:
- IPv4
- IPv6
type: string
name:
description: Name defines the name of this subnet.
type: string
prefixLength:
minimum: 1
description: PrefixLength defines prefix length for this subnet.
type: integer
required:
- name
type: object
type: array
type: object
status:
description: IPPoolStatus defines the observed state of IPPool.
properties:
conditions:
description: Conditions defines current state of the IPPool.
items:
description: Condition defines condition of custom resource.
properties:
lastTransitionTime:
description: Last time the condition transitioned from one status
to another. This should be when the underlying condition changed.
If that is not known, then using the time when the API field
changed is acceptable.
format: date-time
type: string
message:
description: Message shows a human-readable message about condition.
type: string
reason:
description: Reason shows a brief reason of condition.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type defines condition type.
type: string
required:
- status
- type
type: object
type: array
subnets:
description: Subnets defines subnets allocation result.
items:
description: SubnetResult defines the subnet allocation result.
properties:
cidr:
description: CIDR defines the allocated CIDR.
type: string
name:
description: Name defines the name of this subnet.
type: string
required:
- cidr
- name
type: object
type: array
required:
- conditions
- subnets
type: object
required:
- metadata
- spec
type: object
x-kubernetes-preserve-unknown-fields: true
served: true
storage: false
- name: v1alpha2
subresources:
status: {}
- additionalPrinterColumns:
- description: Type of IPPool
jsonPath: .spec.type
name: Type
type: string
- description: CIDRs for the Subnet
jsonPath: .status.subnets[*].cidr
name: Subnets
type: string
name: v1alpha2
schema:
openAPIV3Schema:
description: IPPool is the Schema for the ippools API
description: IPPool is the Schema for the ippools API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down Expand Up @@ -83,14 +172,11 @@ spec:
type: object
type: array
type:
default: private
description: Type defines the type of this IPPool, public or private.
description: Type defines the type of this IPPool, Public or Private.
enum:
- public
- private
- Public
- Private
type: string
required:
- type
type: object
status:
description: IPPoolStatus defines the observed state of IPPool.
Expand Down Expand Up @@ -152,9 +238,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: ["v1alpha2"]
14 changes: 13 additions & 1 deletion build/yaml/crd/nsx.vmware.com_staticroutes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ spec:
singular: staticroute
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: Network in CIDR format
jsonPath: .spec.network
name: Network
type: string
- description: Next Hops
jsonPath: .spec.nextHops[*].ipAddress
name: NextHops
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: StaticRoute is the Schema for the staticroutes API.
Expand Down Expand Up @@ -88,8 +97,11 @@ spec:
- type
type: object
type: array
nsxResourcePath:
type: string
required:
- conditions
- nsxResourcePath
type: object
type: object
served: true
Expand Down
15 changes: 14 additions & 1 deletion build/yaml/crd/nsx.vmware.com_subnetports.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ spec:
singular: subnetport
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: Attachment VIF ID owned by the SubnetPort
jsonPath: .status.vifID
name: VIFID
type: string
- description: IP Address of the SubnetPort
jsonPath: .status.ipAddresses[0].ip
name: IPAddress
type: string
- description: MAC Address of the SubnetPort
jsonPath: .status.macAddress
name: MACAddress
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: SubnetPort is the Schema for the subnetports API.
Expand Down
30 changes: 18 additions & 12 deletions build/yaml/crd/nsx.vmware.com_subnets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ spec:
singular: subnet
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: Access mode of Subnet
jsonPath: .spec.accessMode
name: AccessMode
type: string
- description: Size of Subnet
jsonPath: .spec.ipv4SubnetSize
name: IPv4SubnetSize
type: string
- description: CIDRs for the Subnet
jsonPath: .status.ipAddresses[*]
name: IPAddresses
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: Subnet is the Schema for the subnets API.
Expand Down Expand Up @@ -67,12 +80,11 @@ spec:
type: boolean
type: object
accessMode:
default: private
description: Access mode of Subnet, accessible only from within VPC
or from outside VPC. Defaults to private.
or from outside VPC.
enum:
- private
- public
- Private
- Public
type: string
advancedConfig:
description: Subnet advanced configuration.
Expand All @@ -96,9 +108,7 @@ spec:
minItems: 0
type: array
ipv4SubnetSize:
default: 64
description: Size of Subnet based upon estimated workload count. Defaults
to 64.
description: Size of Subnet based upon estimated workload count.
maximum: 65536
minimum: 16
type: integer
Expand Down Expand Up @@ -140,10 +150,6 @@ spec:
type: array
nsxResourcePath:
type: string
required:
- conditions
- ipAddresses
- nsxResourcePath
type: object
type: object
served: true
Expand Down
29 changes: 18 additions & 11 deletions build/yaml/crd/nsx.vmware.com_subnetsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ spec:
singular: subnetset
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: Access mode of Subnet
jsonPath: .spec.accessMode
name: AccessMode
type: string
- description: Size of Subnet
jsonPath: .spec.ipv4SubnetSize
name: IPv4SubnetSize
type: string
- description: CIDRs for the Subnet
jsonPath: .status.subnets[*].ipAddresses[*]
name: IPAddresses
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: SubnetSet is the Schema for the subnetsets API.
Expand Down Expand Up @@ -67,12 +80,11 @@ spec:
type: boolean
type: object
accessMode:
default: private
description: Access mode of Subnet, accessible only from within VPC
or from outside VPC. Defaults to private.
or from outside VPC.
enum:
- private
- public
- Private
- Public
type: string
advancedConfig:
description: Subnet advanced configuration.
Expand All @@ -89,9 +101,7 @@ spec:
type: object
type: object
ipv4SubnetSize:
default: 64
description: Size of Subnet based upon estimated workload count. Defaults
to 64.
description: Size of Subnet based upon estimated workload count.
maximum: 65536
minimum: 16
type: integer
Expand Down Expand Up @@ -143,9 +153,6 @@ spec:
- nsxResourcePath
type: object
type: array
required:
- conditions
- subnets
type: object
type: object
served: true
Expand Down
Loading

0 comments on commit 0a01661

Please sign in to comment.