Skip to content

Commit

Permalink
Initial auto-gen CRD docs (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
regadas authored Jan 10, 2022
1 parent 18c5936 commit a88ed2b
Show file tree
Hide file tree
Showing 3 changed files with 500 additions and 189 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./api/v1beta1/..."

generate-crd-docs: crd-ref-docs
$(CRD_REF_DOCS) --source-path=./api/v1beta1 --config=docs/config.yaml --renderer=markdown --output-path=docs/crd.md

tidy: ## Run go mod tidy
go mod tidy

Expand Down Expand Up @@ -121,6 +124,10 @@ KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected])

CRD_REF_DOCS = $(shell pwd)/bin/crd-ref-docs
crd-ref-docs:
$(call go-get-tool,$(CRD_REF_DOCS),github.com/elastic/crd-ref-docs@master)

# go-get-tool will 'go get' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
define go-get-tool
Expand Down
12 changes: 12 additions & 0 deletions docs/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
processor:
# RE2 regular expressions describing types that should be excluded from the generated documentation.
ignoreTypes:
- "(FlinkCluster)List$"
# RE2 regular expressions describing type fields that should be excluded from the generated documentation.
ignoreFields:
- "status$"
- "TypeMeta$"

render:
# Version of Kubernetes to use when generating links to Kubernetes API documentation.
kubernetesVersion: 1.23
Loading

0 comments on commit a88ed2b

Please sign in to comment.