Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Auto-Generated API Reference #507

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
export KUBEBUILDER_ASSETS ?= ${HOME}/.kubebuilder/bin
export CLUSTER_NAME ?= $(shell kubectl config view --minify -o jsonpath='{.clusters[].name}' | rev | cut -d"/" -f1 | rev | cut -d"." -f1)
export CLUSTER_VPC_ID ?= $(shell aws eks describe-cluster --name $(CLUSTER_NAME) | jq -r ".cluster.resourcesVpcConfig.vpcId")
export AWS_ACCOUNT_ID ?= $(shell aws sts get-caller-identity --query Account --output text)
export REGION ?= $(shell aws configure get region)
# For all targets except `help` and default target (which is also `help`), export environment variables
ifneq (,$(filter-out help,$(MAKECMDGOALS)))
export KUBEBUILDER_ASSETS ?= ${HOME}/.kubebuilder/bin
export CLUSTER_NAME ?= $(shell kubectl config view --minify -o jsonpath='{.clusters[].name}' | rev | cut -d"/" -f1 | rev | cut -d"." -f1)
export CLUSTER_VPC_ID ?= $(shell aws eks describe-cluster --name $(CLUSTER_NAME) | jq -r ".cluster.resourcesVpcConfig.vpcId")
export AWS_ACCOUNT_ID ?= $(shell aws sts get-caller-identity --query Account --output text)
export REGION ?= $(shell aws configure get region)
endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems we can also put IMG, VERSION, ECRIMAGES in this if block


# Image URL to use all building/pushing image targets
IMG ?= controller:latest
VERSION ?= $(shell git tag --sort=v:refname | tail -1)
Expand Down Expand Up @@ -116,3 +120,9 @@ e2e-clean: ## Delete eks resources created in the e2e test namespace
@kubectl delete namespace $(e2e-test-namespace) > /dev/null 2>&1
@kubectl create namespace $(e2e-test-namespace) > /dev/null 2>&1
@echo "Done!"

.PHONY: api-reference
api-reference: ## Update documentation in docs/api-reference.md
@cd docgen && \
gen-crd-api-reference-docs -config config.json -api-dir "../pkg/apis/applicationnetworking/v1alpha1/" -out-file docs.html && \
cat api-reference-base.md docs.html > ../docs/api-reference.md
2 changes: 1 addition & 1 deletion docgen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Install doc generator

```sh
go install github.com/ahmetb/gen-crd-api-reference-docs
go install github.com/ahmetb/gen-crd-api-reference-docs@v0.3.0
```

Generate html docs
Expand Down
4 changes: 4 additions & 0 deletions docgen/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"List$"
],
"externalPackages": [
{
"typeMatchPrefix": "^sigs\\.k8s\\.io/gateway-api/apis/v1alpha2\\.PolicyTargetReference",
"docsURLTemplate": "https://gateway-api.sigs.k8s.io/geps/gep-713/?h=policytargetreference#policy-targetref-api"
},
{
"typeMatchPrefix": "^k8s\\.io/apimachinery/pkg/apis/meta/v1\\.Duration$",
"docsURLTemplate": "https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#Duration"
Expand Down
Loading