Skip to content

Commit

Permalink
Merge pull request #2352 from randomvariable/eks-crd-docs
Browse files Browse the repository at this point in the history
docs: Add EKS and experimental CRD documentation
  • Loading branch information
k8s-ci-robot authored Apr 15, 2021
2 parents e9d16b0 + 6a38c56 commit c7c8ae1
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 12 deletions.
20 changes: 20 additions & 0 deletions controlplane/eks/api/v1alpha3/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha3 contains API Schema definitions for the controlplane v1alpha3 API group
// +gencrdrefdocs:force
// +groupName=controlplane.cluster.x-k8s.io
package v1alpha3
33 changes: 22 additions & 11 deletions docs/book/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ MDBOOK_RELEASELINK := $(TOOLS_BIN_DIR)/mdbook-releaselink
MDBOOK_TABULATE := $(TOOLS_BIN_DIR)/mdbook-tabulate
GENCRDAPIREFERENCEDOCS := $(TOOLS_BIN_DIR)/gen-crd-api-reference-docs
GENCRDAPIREFERENCEDOCS_SRCS := $(call rwildcard,.,gen-crd-api-reference-docs/*.*)
BOOK_SRCS := $(call rwildcard,.,*.*)
API_SRCS := $(call rwildcard,.,../../cmd/clusterawsadm/api) $(call rwildcard,.,../../api)
CRD_DOCS := src/crd/cluster-api-aws.md src/crd/experimental.md src/crd/eks-control-plane.md
BOOK_SRCS := $(filter-out $(CRD_DOCS), $(call rwildcard,.,*.*))
API_SRCS := $(call rwildcard,.,../../cmd/clusterawsadm/api) $(call rwildcard,.,../../api) $(call rwildcard,.,../../exp/api) $(call rwildcard,.,../../controlplane/eks/api)

OS := $(shell go env GOOS)
ARCH := $(shell go env GOARCH)
Expand All @@ -33,15 +34,23 @@ export PATH
src/crd:
mkdir -p src/crd

src/crd/cluster-api-aws.md: $(GENCRDAPIREFERENCEDOCS) src/crd $(API_SRCS) $(GENCRDAPIREFERENCEDOCS_SRCS) $(BOOK_SRCS)
$(GENCRDAPIREFERENCEDOCS) -template-dir gen-crd-api-reference-docs/template -config "gen-crd-api-reference-docs/config.json" \
-api-dir "../../api/v1alpha3" \
-out-file $@
src/crd/cluster-api-aws.md:
$(MAKE) gen_crd_docs API_DIR="../../api" OUT_FILE=$@

src/crd/experimental.md:
$(MAKE) gen_crd_docs API_DIR="../../exp/api" OUT_FILE=$@

src/crd/eks-control-plane.md:
$(MAKE) gen_crd_docs API_DIR="../../controlplane/eks/api/" OUT_FILE=$@

src/crd/clusterawsadm.md: $(GENCRDAPIREFERENCEDOCS) src/crd $(API_SRCS) $(GENCRDAPIREFERENCEDOCS_SRCS) $(BOOK_SRCS)
src/crd/clusterawsadm.md:
$(MAKE) gen_crd_docs API_DIR="../../cmd/clusterawsadm/api" OUT_FILE=$@

.PHONY: gen_crd_docs
gen_crd_docs: $(GENCRDAPIREFERENCEDOCS) src/crd $(API_SRCS) $(GENCRDAPIREFERENCEDOCS_SRCS)
$(GENCRDAPIREFERENCEDOCS) -template-dir gen-crd-api-reference-docs/template -config "gen-crd-api-reference-docs/config.json" \
-api-dir "../../cmd/clusterawsadm/api" \
-out-file $@
-api-dir $(API_DIR) \
-out-file $(OUT_FILE)

src/clusterawsadm:
mkdir -p src/clusterawsadm
Expand Down Expand Up @@ -76,12 +85,14 @@ verify: generate ## Verify that dependent artifacts are up to date
echo "generated files are out of date, run make generate"; exit 1; \
fi

BOOK_DEPS := $(BOOK_SRCS) $(MDBOOK) $(MDBOOK_EMBED) $(MDBOOK_RELEASELINK) $(MDBOOK_TABULATE) release-policies src/SUMMARY.md $(CRD_DOCS)

.PHONY: build
build: $(BOOK_SRCS) $(MDBOOK) $(MDBOOK_EMBED) $(MDBOOK_RELEASELINK) $(MDBOOK_TABULATE) release-policies src/SUMMARY.md src/crd/clusterawsadm.md src/crd/cluster-api-aws.md ## Build the book
build: $(BOOK_DEPS) ## Build the book
$(MDBOOK) build

.PHONY: serve
serve: $(MDBOOK) $(MDBOOK_EMBED) $(MDBOOK_RELEASELINK) $(MDBOOK_TABULATE) release-policies src/SUMMARY.md src/crd/clusterawsadm.md src/crd/cluster-api-aws.md ## Run a local webserver with the compiled book
serve: $(BOOK_DEPS) ## Run a local webserver with the compiled book
$(MDBOOK) serve

.PHONY: clean
Expand Down
4 changes: 4 additions & 0 deletions docs/book/gen-crd-api-reference-docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
"typeMatchPrefix": "^sigs\\.k8s\\.io/cluster-api/api/v1alpha3",
"docsURLTemplate": "https://doc.crds.dev/github.com/kubernetes-sigs/[email protected]"
},
{
"typeMatchPrefix": "^sigs\\.k8s\\.io/cluster-api/errors",
"docsURLTemplate": "https://pkg.go.dev/sigs.k8s.io/[email protected]/errors#{{.TypeIdentifier}}"
},
{
"typeMatchPrefix": "^time\\.Duration",
"docsURLTemplate": "https://golang.org/pkg/time/#Duration"
Expand Down
4 changes: 3 additions & 1 deletion docs/book/src/SUMMARY_SUFFIX.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
- [CRD Reference](./api/index.md)
- [CRD Reference](./crd/index.md)
- [Cluster API Provider AWS](./crd/cluster-api-aws.md)
- [EKS Control Plane](./crd/eks-control-plane.md)-
- [Experimental APIs](./crd/experimental.md)
- [clusterawsadm Configuration](./crd/clusterawsadm.md)
- [Roadmap](./roadmap.md)
2 changes: 2 additions & 0 deletions exp/api/v1alpha3/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// +gencrdrefdocs:force
// +groupName=infrastructure.cluster.x-k8s.io
package v1alpha3

0 comments on commit c7c8ae1

Please sign in to comment.