Skip to content

Commit

Permalink
Generate crd docs (vmware-tanzu#938) (vmware-tanzu#939)
Browse files Browse the repository at this point in the history
Generate crd docs and improve some descriptions in crd

Signed-off-by: Yanjun Zhou <[email protected]>
  • Loading branch information
yanjunz97 authored Dec 3, 2024
1 parent e157b24 commit 278aaf3
Show file tree
Hide file tree
Showing 12 changed files with 1,391 additions and 12 deletions.
7 changes: 7 additions & 0 deletions .crd-ref-docs/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
processor:
ignoreTypes:
- ".*List$"
ignoreFields:
- "TypeMeta$"
render:
kubernetesVersion: 1.24
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,27 @@ code-generator: ## Download code-generator locally if necessary.
generated: code-generator
./hack/update-codegen.sh

CRD_REF_DOCS = $(shell pwd)/bin/crd-ref-docs
.PHONY: crd-ref-docs
crd-ref-docs: ## Install crd-ref-docs
$(call go-get-tool,$(CRD_REF_DOCS),github.com/elastic/[email protected])

.PHONY: generate-api-docs
generate-api-docs: crd-ref-docs
generate-api-docs: ## Generate API documentation
$(CRD_REF_DOCS) \
--renderer=markdown \
--source-path=./pkg/apis/vpc/v1alpha1 \
--config=./.crd-ref-docs/config.yaml \
--output-path=./docs/ref/apis/
mv ./docs/ref/apis/out.md ./docs/ref/apis/vpc.md
$(CRD_REF_DOCS) \
--renderer=markdown \
--source-path=./pkg/apis/legacy/v1alpha1 \
--config=./.crd-ref-docs/config.yaml \
--output-path=./docs/ref/apis/
mv ./docs/ref/apis/out.md ./docs/ref/apis/legacy.md

ENVTEST = $(shell pwd)/bin/setup-envtest
.PHONY: envtest
envtest: ## Download envtest-setup locally if necessary.
Expand Down
1 change: 1 addition & 0 deletions build/yaml/crd/vpc/crd.nsx.vmware.com_addressbindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ spec:
type: object
type: array
ipAddress:
description: IP Address for port binding.
type: string
required:
- ipAddress
Expand Down
6 changes: 5 additions & 1 deletion build/yaml/crd/vpc/crd.nsx.vmware.com_subnetports.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ spec:
description: SubnetPortStatus defines the observed state of SubnetPort.
properties:
attachment:
description: Subnet port attachment state.
description: SubnetPort attachment state.
properties:
id:
description: ID of the SubnetPort VIF attachment.
type: string
type: object
conditions:
Expand Down Expand Up @@ -107,15 +108,18 @@ spec:
items:
properties:
gateway:
description: Gateway address of the Subnet.
type: string
ipAddress:
description: IP address string with the prefix.
type: string
type: object
type: array
logicalSwitchUUID:
description: The realization id of the SubnetPort
type: string
macAddress:
description: The MAC address.
type: string
type: object
type: object
Expand Down
3 changes: 3 additions & 0 deletions build/yaml/crd/vpc/crd.nsx.vmware.com_subnets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ spec:
description: SubnetStatus defines the observed state of Subnet.
properties:
DHCPServerAddresses:
description: DHCP server IP address.
items:
type: string
type: array
Expand Down Expand Up @@ -146,10 +147,12 @@ spec:
type: object
type: array
gatewayAddresses:
description: Gateway address of the Subnet.
items:
type: string
type: array
networkAddresses:
description: Network address of the Subnet.
items:
type: string
type: array
Expand Down
5 changes: 4 additions & 1 deletion build/yaml/crd/vpc/crd.nsx.vmware.com_subnetsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ spec:
- message: Value is immutable
rule: self == oldSelf
subnetDHCPConfig:
description: DHCPConfig DHCP configuration.
description: Subnet DHCP configuration.
properties:
mode:
description: |-
Expand Down Expand Up @@ -135,14 +135,17 @@ spec:
of a SubnetSet.
properties:
DHCPServerAddresses:
description: Dhcp server IP address.
items:
type: string
type: array
gatewayAddresses:
description: Gateway address of the Subnet.
items:
type: string
type: array
networkAddresses:
description: Network address of the Subnet.
items:
type: string
type: array
Expand Down
Loading

0 comments on commit 278aaf3

Please sign in to comment.