Skip to content

Commit c7c8ae1

Browse files
authored
Merge pull request #2352 from randomvariable/eks-crd-docs
docs: Add EKS and experimental CRD documentation
2 parents e9d16b0 + 6a38c56 commit c7c8ae1

File tree

5 files changed

+51
-12
lines changed

5 files changed

+51
-12
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
Copyright 2021 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package v1alpha3 contains API Schema definitions for the controlplane v1alpha3 API group
18+
// +gencrdrefdocs:force
19+
// +groupName=controlplane.cluster.x-k8s.io
20+
package v1alpha3

docs/book/Makefile

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ MDBOOK_RELEASELINK := $(TOOLS_BIN_DIR)/mdbook-releaselink
2222
MDBOOK_TABULATE := $(TOOLS_BIN_DIR)/mdbook-tabulate
2323
GENCRDAPIREFERENCEDOCS := $(TOOLS_BIN_DIR)/gen-crd-api-reference-docs
2424
GENCRDAPIREFERENCEDOCS_SRCS := $(call rwildcard,.,gen-crd-api-reference-docs/*.*)
25-
BOOK_SRCS := $(call rwildcard,.,*.*)
26-
API_SRCS := $(call rwildcard,.,../../cmd/clusterawsadm/api) $(call rwildcard,.,../../api)
25+
CRD_DOCS := src/crd/cluster-api-aws.md src/crd/experimental.md src/crd/eks-control-plane.md
26+
BOOK_SRCS := $(filter-out $(CRD_DOCS), $(call rwildcard,.,*.*))
27+
API_SRCS := $(call rwildcard,.,../../cmd/clusterawsadm/api) $(call rwildcard,.,../../api) $(call rwildcard,.,../../exp/api) $(call rwildcard,.,../../controlplane/eks/api)
2728

2829
OS := $(shell go env GOOS)
2930
ARCH := $(shell go env GOARCH)
@@ -33,15 +34,23 @@ export PATH
3334
src/crd:
3435
mkdir -p src/crd
3536

36-
src/crd/cluster-api-aws.md: $(GENCRDAPIREFERENCEDOCS) src/crd $(API_SRCS) $(GENCRDAPIREFERENCEDOCS_SRCS) $(BOOK_SRCS)
37-
$(GENCRDAPIREFERENCEDOCS) -template-dir gen-crd-api-reference-docs/template -config "gen-crd-api-reference-docs/config.json" \
38-
-api-dir "../../api/v1alpha3" \
39-
-out-file $@
37+
src/crd/cluster-api-aws.md:
38+
$(MAKE) gen_crd_docs API_DIR="../../api" OUT_FILE=$@
39+
40+
src/crd/experimental.md:
41+
$(MAKE) gen_crd_docs API_DIR="../../exp/api" OUT_FILE=$@
42+
43+
src/crd/eks-control-plane.md:
44+
$(MAKE) gen_crd_docs API_DIR="../../controlplane/eks/api/" OUT_FILE=$@
4045

41-
src/crd/clusterawsadm.md: $(GENCRDAPIREFERENCEDOCS) src/crd $(API_SRCS) $(GENCRDAPIREFERENCEDOCS_SRCS) $(BOOK_SRCS)
46+
src/crd/clusterawsadm.md:
47+
$(MAKE) gen_crd_docs API_DIR="../../cmd/clusterawsadm/api" OUT_FILE=$@
48+
49+
.PHONY: gen_crd_docs
50+
gen_crd_docs: $(GENCRDAPIREFERENCEDOCS) src/crd $(API_SRCS) $(GENCRDAPIREFERENCEDOCS_SRCS)
4251
$(GENCRDAPIREFERENCEDOCS) -template-dir gen-crd-api-reference-docs/template -config "gen-crd-api-reference-docs/config.json" \
43-
-api-dir "../../cmd/clusterawsadm/api" \
44-
-out-file $@
52+
-api-dir $(API_DIR) \
53+
-out-file $(OUT_FILE)
4554

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

88+
BOOK_DEPS := $(BOOK_SRCS) $(MDBOOK) $(MDBOOK_EMBED) $(MDBOOK_RELEASELINK) $(MDBOOK_TABULATE) release-policies src/SUMMARY.md $(CRD_DOCS)
89+
7990
.PHONY: build
80-
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
91+
build: $(BOOK_DEPS) ## Build the book
8192
$(MDBOOK) build
8293

8394
.PHONY: serve
84-
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
95+
serve: $(BOOK_DEPS) ## Run a local webserver with the compiled book
8596
$(MDBOOK) serve
8697

8798
.PHONY: clean

docs/book/gen-crd-api-reference-docs/config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
"typeMatchPrefix": "^sigs\\.k8s\\.io/cluster-api/api/v1alpha3",
3232
"docsURLTemplate": "https://doc.crds.dev/github.com/kubernetes-sigs/[email protected]"
3333
},
34+
{
35+
"typeMatchPrefix": "^sigs\\.k8s\\.io/cluster-api/errors",
36+
"docsURLTemplate": "https://pkg.go.dev/sigs.k8s.io/[email protected]/errors#{{.TypeIdentifier}}"
37+
},
3438
{
3539
"typeMatchPrefix": "^time\\.Duration",
3640
"docsURLTemplate": "https://golang.org/pkg/time/#Duration"

docs/book/src/SUMMARY_SUFFIX.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
- [CRD Reference](./api/index.md)
1+
- [CRD Reference](./crd/index.md)
22
- [Cluster API Provider AWS](./crd/cluster-api-aws.md)
3+
- [EKS Control Plane](./crd/eks-control-plane.md)-
4+
- [Experimental APIs](./crd/experimental.md)
35
- [clusterawsadm Configuration](./crd/clusterawsadm.md)
46
- [Roadmap](./roadmap.md)

exp/api/v1alpha3/doc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

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

0 commit comments

Comments
 (0)