Skip to content

Commit c746a84

Browse files
TF Plugin Docs - migrating to new structure (#2470)
Co-authored-by: Aleksandr Rybolovlev <[email protected]>
1 parent 4f75983 commit c746a84

File tree

420 files changed

+21993
-1217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

420 files changed

+21993
-1217
lines changed

.changelog/2470.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:doc
2+
Migrate legacy structure to new tfplugindocs template structure
3+
```

.github/workflows/checkers-and-linters.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ jobs:
3636
make vet
3737
- name: Run linters
3838
run: |
39-
make website-lint
39+
make docs-lint
4040
make tests-lint

.github/workflows/markdown-link-check.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
branches:
99
- main
1010
paths:
11-
- 'website/docs/**'
11+
- 'docs/**'
1212
workflow_dispatch:
1313

1414
jobs:
@@ -24,7 +24,7 @@ jobs:
2424
base-branch: main
2525
config-file: '.github/workflows/markdown.links.config.json'
2626
file-extension: '.markdown'
27-
folder-path: 'website/docs'
27+
folder-path: 'docs'
2828
use-verbose-mode: yes
2929
use-quiet-mode: yes
3030
max-depth: 2

.github/workflows/markdown.links.config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
},
1919
{
2020
"pattern": "^/docs/providers/kubernetes/",
21-
"replacement": "file:///github/workspace/website/docs/"
21+
"replacement": "file:///github/workspace/docs/"
2222
},
2323
{
2424
"pattern": "^(getting-started).html.markdown(#.*)?$",
25-
"replacement": "file:///github/workspace/website/docs/guides/$1.html.md$2"
25+
"replacement": "file:///github/workspace/docs/guides/$1.html.md$2"
2626
},
2727
{
28-
"pattern": "^file:///github/workspace/website/docs/guides/(.*)\\.markdown(#.*)?$",
29-
"replacement": "file:///github/workspace/website/docs/guides/$1.md$2"
28+
"pattern": "^file:///github/workspace/docs/guides/(.*)\\.markdown(#.*)?$",
29+
"replacement": "file:///github/workspace/docs/guides/$1.md$2"
3030
}
3131
]
3232
}

.markdownlinkcheck.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
},
1919
{
2020
"pattern": "^/docs/providers/kubernetes/",
21-
"replacement": "file:///github/workspace/website/docs/"
21+
"replacement": "file:///github/workspace/docs/"
2222
},
2323
{
2424
"pattern": "^(getting-started).html.markdown(#.*)?$",
25-
"replacement": "file:///github/workspace/website/docs/guides/$1.html.md$2"
25+
"replacement": "file:///github/workspace/docs/guides/$1.html.md$2"
2626
},
2727
{
28-
"pattern": "^file:///github/workspace/website/docs/guides/(.*)\\.markdown(#.*)?$",
29-
"replacement": "file:///github/workspace/website/docs/guides/$1.md$2"
28+
"pattern": "^file:///github/workspace/docs/guides/(.*)\\.markdown(#.*)?$",
29+
"replacement": "file:///github/workspace/docs/guides/$1.md$2"
3030
}
3131
]
3232
}

GNUmakefile

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
PROVIDER_DIR := $(abspath $(lastword $(dir $(MAKEFILE_LIST))))
44
TEST := "$(PROVIDER_DIR)/kubernetes"
55
GOFMT_FILES := $$(find $(PROVIDER_DIR) -name '*.go')
6-
WEBSITE_REPO := github.com/hashicorp/terraform-website
76
PKG_NAME := kubernetes
87
OS_ARCH := $(shell go env GOOS)_$(shell go env GOARCH)
98
TF_PROV_DOCS := $(PWD)/kubernetes/test-infra/tfproviderdocs
@@ -24,7 +23,7 @@ PARALLEL_RUNS?=8
2423

2524
default: build
2625

27-
all: build depscheck fmtcheck test testacc test-compile tests-lint tests-lint-fix tools vet website-lint website-lint-fix
26+
all: build depscheck fmtcheck test testacc test-compile tests-lint tests-lint-fix tools vet docs-lint docs-lint-fix
2827

2928
build: fmtcheck
3029
go install
@@ -125,8 +124,8 @@ vet:
125124

126125
# The docker command and run options may be overridden using env variables DOCKER and DOCKER_RUN_OPTS.
127126
# Example:
128-
# DOCKER="podman --cgroup-manager=cgroupfs" make website-lint
129-
# DOCKER_RUN_OPTS="--userns=keep-id" make website-lint
127+
# DOCKER="podman --cgroup-manager=cgroupfs" make docs-lint
128+
# DOCKER_RUN_OPTS="--userns=keep-id" make docs-lint
130129
# This option is needed for systems using SELinux and rootless containers.
131130
# DOCKER_VOLUME_OPTS="rw,Z"
132131
# For more info, see https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label
@@ -140,40 +139,40 @@ ifeq ($(.SHELLSTATUS),0)
140139
DOCKER_VOLUME_OPTS="rw,Z"
141140
endif
142141

143-
website-lint: tools
142+
docs-lint: tools
144143
@echo "==> Checking website against linters..."
145-
@misspell -error -source=text ./website || (echo; \
144+
@misspell -error -source=text ./docs || (echo; \
146145
echo "Unexpected mispelling found in website files."; \
147-
echo "To automatically fix the misspelling, run 'make website-lint-fix' and commit the changes."; \
146+
echo "To automatically fix the misspelling, run 'make docs-lint-fix' and commit the changes."; \
148147
exit 1)
149148
@echo "==> Running markdownlint-cli using DOCKER='$(DOCKER)', DOCKER_RUN_OPTS='$(DOCKER_RUN_OPTS)' and DOCKER_VOLUME_OPTS='$(DOCKER_VOLUME_OPTS)'"
150-
@$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(PROVIDER_DIR):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace 06kellyjac/markdownlint-cli ./website || (echo; \
149+
@$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(PROVIDER_DIR):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace 06kellyjac/markdownlint-cli ./docs || (echo; \
151150
echo "Unexpected issues found in website Markdown files."; \
152-
echo "To apply any automatic fixes, run 'make website-lint-fix' and commit the changes."; \
151+
echo "To apply any automatic fixes, run 'make docs-lint-fix' and commit the changes."; \
153152
exit 1)
154153
@echo "==> Running terrafmt diff..."
155-
@terrafmt diff ./website --check --pattern '*.markdown' --quiet || (echo; \
154+
@terrafmt diff ./docs --check --pattern '*.markdown' --quiet || (echo; \
156155
echo "Unexpected differences in website HCL formatting."; \
157-
echo "To see the full differences, run: terrafmt diff ./website --pattern '*.markdown'"; \
158-
echo "To automatically fix the formatting, run 'make website-lint-fix' and commit the changes."; \
156+
echo "To see the full differences, run: terrafmt diff ./docs --pattern '*.markdown'"; \
157+
echo "To automatically fix the formatting, run 'make docs-lint-fix' and commit the changes."; \
159158
exit 1)
160159
@echo "==> Statically compiling provider for tfproviderdocs..."
161160
@env CGO_ENABLED=0 GOOS=$$(go env GOOS) GOARCH=$$(go env GOARCH) go build -a -o $(TF_PROV_DOCS)/terraform-provider-kubernetes
162161
@echo "==> Getting provider schema for tfproviderdocs..."
163-
@$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(TF_PROV_DOCS):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace hashicorp/terraform:0.12.29 init
164-
@$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(TF_PROV_DOCS):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace hashicorp/terraform:0.12.29 providers schema -json > $(TF_PROV_DOCS)/schema.json
162+
@$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(TF_PROV_DOCS):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace hashicorp/terraform:1.8.2 init
163+
@$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(TF_PROV_DOCS):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace hashicorp/terraform:1.8.2 providers schema -json > $(TF_PROV_DOCS)/schema.json
165164
@echo "==> Running tfproviderdocs..."
166165
@tfproviderdocs check -providers-schema-json $(TF_PROV_DOCS)/schema.json -provider-name kubernetes
167166
@rm -f $(TF_PROV_DOCS)/schema.json $(TF_PROV_DOCS)/terraform-provider-kubernetes
168167
@echo "==> Checking for broken links..."
169168
@scripts/markdown-link-check.sh "$(DOCKER)" "$(DOCKER_RUN_OPTS)" "$(DOCKER_VOLUME_OPTS)" "$(PROVIDER_DIR)"
170169

171-
website-lint-fix: tools
170+
docs-lint-fix: tools
172171
@echo "==> Applying automatic website linter fixes..."
173-
@misspell -w -source=text ./website
172+
@misspell -w -source=text ./docs
174173
@echo "==> Running markdownlint-cli --fix using DOCKER='$(DOCKER)', DOCKER_RUN_OPTS='$(DOCKER_RUN_OPTS)' and DOCKER_VOLUME_OPTS='$(DOCKER_VOLUME_OPTS)'"
175-
@$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(PROVIDER_DIR):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace 06kellyjac/markdownlint-cli --fix ./website
174+
@$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(PROVIDER_DIR):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace 06kellyjac/markdownlint-cli --fix ./docs
176175
@echo "==> Fixing website terraform blocks code with terrafmt..."
177-
@terrafmt fmt ./website --pattern '*.markdown'
176+
@terrafmt fmt ./docs --pattern '*.markdown'
178177

179-
.PHONY: build test testacc tools vet fmt fmtcheck terrafmt test-compile depscheck tests-lint tests-lint-fix website-lint website-lint-fix changelog changelog-entry
178+
.PHONY: build test testacc tools vet fmt fmtcheck terrafmt test-compile depscheck tests-lint tests-lint-fix docs-lint docs-lint-fix changelog changelog-entry
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
---
22
subcategory: "core/v1"
3-
layout: "kubernetes"
43
page_title: "Kubernetes: kubernetes_all_namespaces"
54
description: |-
65
Lists all namespaces within a cluster.
76
---
87

98
# kubernetes_all_namespaces
109

11-
This data source provides a mechanism for listing the names of all available namespaces in a Kubernetes cluster.
12-
It can be used to check for existence of a specific namespaces or to apply another resource to all or a subset of existing namespaces in a cluster.
10+
This data source provides a mechanism for listing the names of all available namespaces in a Kubernetes cluster. It can be used to check for existence of a specific namespaces or to apply another resource to all or a subset of existing namespaces in a cluster.
1311

1412
In Kubernetes, namespaces provide a scope for names and are intended as a way to divide cluster resources between multiple users.
1513

1614
## Example Usage
1715

18-
```hcl
16+
```terraform
1917
data "kubernetes_all_namespaces" "allns" {}
2018
2119
output "all-ns" {
@@ -25,5 +23,4 @@ output "all-ns" {
2523
output "ns-present" {
2624
value = contains(data.kubernetes_all_namespaces.allns.namespaces, "kube-system")
2725
}
28-
2926
```

website/docs/d/config_map.html.markdown renamed to docs/data-sources/config_map.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
subcategory: "core/v1"
3-
layout: "kubernetes"
43
page_title: "Kubernetes: kubernetes_config_map"
54
description: |-
65
This data source reads configuration data from a config map.
@@ -14,7 +13,7 @@ Config Maps are key-value pairs containing configuration data. The Config Map da
1413

1514
## Example Usage
1615

17-
```hcl
16+
```terraform
1817
data "kubernetes_config_map" "example" {
1918
metadata {
2019
name = "my-config"

website/docs/d/config_map_v1.html.markdown renamed to docs/data-sources/config_map_v1.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
subcategory: "core/v1"
3-
layout: "kubernetes"
43
page_title: "Kubernetes: kubernetes_config_map_v1"
54
description: |-
65
This data source reads configuration data from a config map.
@@ -14,7 +13,7 @@ Config Maps are key-value pairs containing configuration data. The Config Map da
1413

1514
## Example Usage
1615

17-
```hcl
16+
```terraform
1817
data "kubernetes_config_map_v1" "example" {
1918
metadata {
2019
name = "my-config"

website/docs/d/endpoints_v1.html.markdown renamed to docs/data-sources/endpoints_v1.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
subcategory: "core/v1"
3-
layout: "kubernetes"
43
page_title: "Kubernetes: kubernetes_endpoints_v1"
54
description: |-
65
An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service.
@@ -10,10 +9,9 @@ description: |-
109

1110
An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service.
1211

13-
1412
## Example Usage
1513

16-
```hcl
14+
```terraform
1715
data "kubernetes_endpoints_v1" "api_endpoints" {
1816
metadata {
1917
name = "kubernetes"
@@ -39,7 +37,6 @@ The following arguments are supported:
3937

4038
#### Attributes
4139

42-
4340
* `generation` - A sequence number representing a specific generation of the desired state.
4441
* `resource_version` - An opaque value that represents the internal version of this endpoints resource that can be used by clients to determine when endpoints resource has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency)
4542
* `uid` - The unique in time and space value for this endpoints resource. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids)
@@ -77,4 +74,3 @@ The following arguments are supported:
7774
* `name` - (Optional) The name of this port within the endpoint. All ports within the endpoint must have unique names. Optional if only one port is defined on this endpoint.
7875
* `port` - (Required) The port that will be utilized by this endpoint.
7976
* `protocol` - (Optional) The IP protocol for this port. Supports `TCP` and `UDP`. Default is `TCP`.
80-

0 commit comments

Comments
 (0)