Skip to content

Commit 82bd596

Browse files
authored
Add kubeconform docs and cleanup (#1191)
* Add kubeconform docs and cleanup Signed-off-by: Fiachra Corcoran <[email protected]> * Remove more GCP data Signed-off-by: Fiachra Corcoran <[email protected]> * Add netlify.toml Signed-off-by: Fiachra Corcoran <[email protected]> * Downgrade docsy Signed-off-by: Fiachra Corcoran <[email protected]> --------- Signed-off-by: Fiachra Corcoran <[email protected]>
1 parent d2017a9 commit 82bd596

File tree

1,773 files changed

+608
-1783879
lines changed

Some content is hidden

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

1,773 files changed

+608
-1783879
lines changed

.gitignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
.idea
22
.vscode
33
dist
4-
node_modules
4+
5+
# Node dependencies
6+
node_modules/
7+
package-lock.json
8+
59
*.iml
610
.npmrc
711
.DS_Store
@@ -10,6 +14,12 @@ bin/
1014
__pycache__
1115
.docker
1216
documentation/resources
17+
documentation/content/en/examples
18+
19+
# Hugo
20+
.hugo*
21+
resources/
22+
public/
1323

1424
# We use sed -i.bak when doing in-line replace, because it works better cross-platform
1525
*.bak

documentation/Makefile

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
serve: copy-examples
1+
serve: clean copy-examples inject-relatedexamples
22
hugo server \
33
--disableFastRender \
44
--buildDrafts \
@@ -12,13 +12,13 @@ serve: copy-examples
1212
--templateMetricsHints \
1313
--gc
1414

15-
production-build: copy-examples
15+
production-build: copy-examples inject-relatedexamples
1616
hugo version
1717
hugo \
1818
--minify
1919
npx -y pagefind --site public
2020

21-
preview-build: copy-examples
21+
preview-build: copy-examples inject-relatedexamples
2222
hugo \
2323
--baseURL $(DEPLOY_PRIME_URL) \
2424
--buildDrafts \
@@ -27,8 +27,35 @@ preview-build: copy-examples
2727
npx -y pagefind --site public
2828

2929
copy-examples:
30-
# mkdir -p public/examples
31-
# cp -R ../examples public/examples
30+
@mkdir -p content/en/examples
31+
@echo "Syncing only README.md files"
32+
@rsync -av \
33+
--exclude='.expected/' \
34+
--include='*/' \
35+
--include='README.md' \
36+
--exclude='*' \
37+
../examples/ content/en/examples/
3238

33-
mkdir -p content/en/
34-
cp -R ../examples content/en/examples
39+
inject-relatedexamples:
40+
@echo "Injecting {{< relatedexamples >}} shortcode above 'Overview'..."
41+
@find content/en/examples -type f -name "README.md" ! -path "*/.expected/*" | while read file; do \
42+
if ! grep -q '{{< relatedexamples' "$$file"; then \
43+
if grep -qi '^### *Overview' "$$file"; then \
44+
echo "Updating $$file with relatedexamples shortcode"; \
45+
tmpfile=$$(mktemp); \
46+
awk -v shortcode="{{< relatedexamples >}}" 'BEGIN{inserted=0} \
47+
/^### *[Oo]verview/ && !inserted {print shortcode "\n"; inserted=1} \
48+
{print}' "$$file" > "$$tmpfile"; \
49+
mv "$$tmpfile" "$$file"; \
50+
fi; \
51+
fi; \
52+
done
53+
54+
55+
clean:
56+
rm -rf content/en/examples \
57+
node_modules \
58+
public \
59+
resources \
60+
.hugo_build.lock \
61+
package-lock.json
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
---
2-
title: Function Catalog
32
linkTitle: Function Catalog
4-
description: Function Catalog
53
toc_hide: false
64
menu:
75
main:
@@ -10,5 +8,4 @@ menu:
108

119
## Curated Functions Catalog
1210

13-
1411
{{< listfunctions >}}

documentation/content/en/function-catalog/apply-replacements/v0.1/_index.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ linkTitle: "apply-replacements"
44
tags: "mutator"
55
weight: 4
66
description: |
7-
Use the [kustomize replacements] feature as a KRM function.
7+
Use the kustomize replacements feature as a KRM function
88
menu:
99
main:
1010
parent: "Function Catalog"
1111
---
1212

13-
14-
# apply-replacements
15-
1613
{{< listversions >}}
1714

1815
{{< listexamples >}}

documentation/content/en/function-catalog/apply-setters/v0.1/_index.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@ title: "apply-setters"
33
linkTitle: "apply-setters"
44
tags: "mutator"
55
weight: 4
6-
description: |
7-
Update the field values parameterized by setters.
6+
description: Update the field values parameterized by setters
87
menu:
98
main:
109
parent: "Function Catalog"
1110
---
1211

13-
14-
# apply-setters
15-
1612
{{< listversions >}}
1713

1814
{{< listexamples >}}
@@ -40,7 +36,7 @@ A setter comment can be derived by replacing all the instances of setter values
4036
in the field value, with the corresponding setter names along with 'kpt-set:' prefix.
4137

4238
```shell
43-
e.g. image: gcr.io/nginx:1.16.1 # kpt-set: gcr.io/${image}:${tag}
39+
e.g. image: ghcr.io/nginx:1.16.1 # kpt-set: ghcr.io/${image}:${tag}
4440
```
4541

4642
<!--mdtogo-->
@@ -117,13 +113,13 @@ data:
117113
Invoke the function:
118114

119115
```shell
120-
$ kpt fn eval --image gcr.io/kpt-fn/apply-setters:v0.1.1 --fn-config ./apply-setters-fn-config
116+
$ kpt fn eval --image ghcr.io/kptdev/krm-functions-catalog/apply-setters:v0.1 --fn-config ./apply-setters-fn-config
121117
```
122118

123119
Alternatively, setter values can be passed as key-value pairs in the CLI
124120

125121
```shell
126-
$ kpt fn eval --image gcr.io/kpt-fn/apply-setters:v0.1.1 -- image=ubuntu replicas=3
122+
$ kpt fn eval --image ghcr.io/kptdev/krm-functions-catalog/apply-setters:v0.1 -- image=ubuntu replicas=3
127123
```
128124

129125
Modified resource looks like the following:
@@ -186,7 +182,7 @@ data:
186182
Invoke the function using the input config:
187183

188184
```shell
189-
$ kpt fn eval --image gcr.io/kpt-fn/apply-setters:v0.1.1 --fn-config ./apply-setters-fn-config
185+
$ kpt fn eval --image ghcr.io/kptdev/krm-functions-catalog/apply-setters:v0.1 --fn-config ./apply-setters-fn-config
190186
```
191187

192188
Modified resource looks like the following:
@@ -205,4 +201,4 @@ environments: # kpt-set: ${env}
205201

206202
#### Note:
207203

208-
Refer to the `create-setters` function documentation for information about creating setters.
204+
Refer to the [`create-setters`]({{< relref "function-catalog/create-setters/v0.1/" >}}) function documentation for information about creating setters.

documentation/content/en/function-catalog/apply-setters/v0.2/_index.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,11 @@ title: "apply-setters"
33
linkTitle: "apply-setters"
44
tags: "mutator"
55
weight: 4
6-
description: |
7-
Update the field values parameterized by setters.
6+
description: Update the field values parameterized by setters
87
menu:
98
main:
109
parent: "Function Catalog"
1110
---
12-
13-
14-
# apply-setters
15-
1611
{{< listversions >}}
1712

1813
{{< listexamples >}}
@@ -40,7 +35,7 @@ A setter comment can be derived by replacing all the instances of setter values
4035
in the field value, with the corresponding setter names along with 'kpt-set:' prefix.
4136

4237
```shell
43-
e.g. image: gcr.io/nginx:1.16.1 # kpt-set: gcr.io/${image}:${tag}
38+
e.g. image: ghcr.io/nginx:1.16.1 # kpt-set: ghcr.io/${image}:${tag}
4439
```
4540

4641
<!--mdtogo-->
@@ -117,13 +112,13 @@ data:
117112
Invoke the function:
118113

119114
```shell
120-
$ kpt fn eval --image gcr.io/kpt-fn/apply-setters:v0.2.0 --fn-config ./apply-setters-fn-config
115+
$ kpt fn eval --image ghcr.io/kptdev/krm-functions-catalog/apply-setters:v0.2 --fn-config ./apply-setters-fn-config
121116
```
122117

123118
Alternatively, setter values can be passed as key-value pairs in the CLI
124119

125120
```shell
126-
$ kpt fn eval --image gcr.io/kpt-fn/apply-setters:v0.2.0 -- image=ubuntu replicas=3
121+
$ kpt fn eval --image ghcr.io/kptdev/krm-functions-catalog/apply-setters:v0.2 -- image=ubuntu replicas=3
127122
```
128123

129124
Modified resource looks like the following:
@@ -186,7 +181,7 @@ data:
186181
Invoke the function using the input config:
187182

188183
```shell
189-
$ kpt fn eval --image gcr.io/kpt-fn/apply-setters:v0.2.0 --fn-config ./apply-setters-fn-config
184+
$ kpt fn eval --image ghcr.io/kptdev/krm-functions-catalog/apply-setters:v0.2 --fn-config ./apply-setters-fn-config
190185
```
191186

192187
Modified resource looks like the following:
@@ -205,4 +200,4 @@ environments: # kpt-set: ${env}
205200

206201
#### Note:
207202

208-
Refer to the `create-setters` function documentation for information about creating setters.
203+
Refer to the [`create-setters`]({{< relref "function-catalog/create-setters/v0.1/" >}}) function documentation for information about creating setters.

documentation/content/en/function-catalog/create-setters/v0.1/_index.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ linkTitle: "create-setters"
44
tags: "mutator"
55
weight: 4
66
description: |
7-
Parameterize the field values by adding [setter] comments.
7+
Parameterize the field values by adding `setter` comments.
88
menu:
99
main:
1010
parent: "Function Catalog"
1111
---
1212

13-
# create-setters
14-
1513
{{< listversions >}}
1614

1715
{{< listexamples >}}
@@ -50,14 +48,11 @@ data:
5048
- For an array node, checks if all values match with any of the array setters.
5149
4. Adds comments to the fields matching the setter values using setter names as parameters.
5250

53-
>? If this function adds setter comments to the fields for which you didn't intend to parameterize,
51+
> If this function adds setter comments to the fields for which you didn't intend to parameterize,
5452
you can simply review and delete/modify those comments manually.
5553

5654
<!--mdtogo-->
5755

58-
?> If this function adds setter comments to fields for which you didn't intend
59-
to parameterize, you can simply review and delete/modify those comments manually.
60-
6156
### Examples
6257

6358
<!--mdtogo:Examples-->
@@ -106,13 +101,13 @@ data:
106101
Invoke the function:
107102

108103
```shell
109-
$ kpt fn eval --image gcr.io/kpt-fn/create-setters:v0.1.0 --fn-config ./create-setters-fn-config.yaml
104+
$ kpt fn eval --image ghcr.io/kptdev/krm-functions-catalog/create-setters:v0.1 --fn-config ./create-setters-fn-config.yaml
110105
```
111106

112107
Alternatively, setter values can be passed as key-value pairs in the CLI
113108

114109
```shell
115-
$ kpt fn eval --image gcr.io/kpt-fn/create-setters:v0.1.0 -- replicas=4 tag=1.1.2
110+
$ kpt fn eval --image ghcr.io/kptdev/krm-functions-catalog/create-setters:v0.1 -- replicas=4 tag=1.1.2
116111
```
117112

118113
Modified resource looks like the following:
@@ -141,7 +136,7 @@ spec:
141136
containerPort: 80
142137
```
143138

144-
>? This function doesn't add comments to scalar nodes with multi-line values.
139+
> This function doesn't add comments to scalar nodes with multi-line values.
145140

146141
Explanation for the changes:
147142

@@ -187,7 +182,7 @@ data:
187182
```
188183

189184
```shell
190-
$ kpt fn eval --image gcr.io/kpt-fn/create-setters:v0.1.0 --fn-config ./create-setters-fn-config.yaml
185+
$ kpt fn eval --image ghcr.io/kptdev/krm-functions-catalog/create-setters:v0.1 --fn-config ./create-setters-fn-config.yaml
191186
```
192187

193188
Modified resource looks like the following:
@@ -208,4 +203,4 @@ Explanation for the changes:
208203
Here, the comment is added to the `environments` field as it is an array node, and the intent is to paremeterize entire array.
209204
<!--mdtogo-->
210205

211-
[setter]: https://catalog.kpt.dev/apply-setters/v0.1/?id=definitions
206+
[setter]: {{< relref "function-catalog/apply-setters/v0.2/#definitions" >}}

0 commit comments

Comments
 (0)