From 52b33f7142e1a5fbe6042536dbb5330c3d236279 Mon Sep 17 00:00:00 2001 From: Max Jonas Werner Date: Thu, 23 Mar 2023 14:21:38 +0100 Subject: [PATCH] GA: adapt to SC, NC and KC APIs graduating to v1 The following API types have been graduated to v1: - NC Receiver - KC Kustomization - SC GitRepository In addition to that we want the API navigation entries to appear at the bottom of the tree. To accomplish that the import script is now able to parse a weight parameter from imported markdown specs and put it into the front matter of the resulting file. refs fluxcd/notification-controller#436 Signed-off-by: Max Jonas Werner --- .../en/flux/components/kustomize/.gitignore | 2 +- .../flux/components/kustomize/api/_index.md | 5 ++++ .../en/flux/components/kustomize/options.md | 2 +- .../flux/components/notification/.gitignore | 2 +- .../flux/components/notification/api/.gitkeep | 0 .../components/notification/api/_index.md | 5 ++++ .../flux/components/notification/options.md | 2 +- content/en/flux/components/source/.gitignore | 2 +- .../en/flux/components/source/api/_index.md | 5 ++++ content/en/flux/components/source/options.md | 2 +- hack/import-flux2-assets.sh | 23 +++++++++++++------ 11 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 content/en/flux/components/kustomize/api/_index.md create mode 100644 content/en/flux/components/notification/api/.gitkeep create mode 100644 content/en/flux/components/notification/api/_index.md create mode 100644 content/en/flux/components/source/api/_index.md diff --git a/content/en/flux/components/kustomize/.gitignore b/content/en/flux/components/kustomize/.gitignore index 86bb6f59d..db062c043 100644 --- a/content/en/flux/components/kustomize/.gitignore +++ b/content/en/flux/components/kustomize/.gitignore @@ -1,2 +1,2 @@ -api.md +api/v*.md kustomization.md diff --git a/content/en/flux/components/kustomize/api/_index.md b/content/en/flux/components/kustomize/api/_index.md new file mode 100644 index 000000000..ea8b91346 --- /dev/null +++ b/content/en/flux/components/kustomize/api/_index.md @@ -0,0 +1,5 @@ +--- +title: API Reference +linkTitle: API Reference +weight: 1000 +--- diff --git a/content/en/flux/components/kustomize/options.md b/content/en/flux/components/kustomize/options.md index bb0137806..629998beb 100644 --- a/content/en/flux/components/kustomize/options.md +++ b/content/en/flux/components/kustomize/options.md @@ -2,7 +2,7 @@ title: Controller Options linkTitle: Controller Options description: "Controller command flags and defaults." -weight: 1000 +weight: 1 --- To customise the controller options at install time, diff --git a/content/en/flux/components/notification/.gitignore b/content/en/flux/components/notification/.gitignore index c342f3c11..772e150e5 100644 --- a/content/en/flux/components/notification/.gitignore +++ b/content/en/flux/components/notification/.gitignore @@ -1,5 +1,5 @@ alert.md -api.md +api/v*.md event.md provider.md receiver.md diff --git a/content/en/flux/components/notification/api/.gitkeep b/content/en/flux/components/notification/api/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/content/en/flux/components/notification/api/_index.md b/content/en/flux/components/notification/api/_index.md new file mode 100644 index 000000000..ea8b91346 --- /dev/null +++ b/content/en/flux/components/notification/api/_index.md @@ -0,0 +1,5 @@ +--- +title: API Reference +linkTitle: API Reference +weight: 1000 +--- diff --git a/content/en/flux/components/notification/options.md b/content/en/flux/components/notification/options.md index dc491d994..9fd3e0944 100644 --- a/content/en/flux/components/notification/options.md +++ b/content/en/flux/components/notification/options.md @@ -2,7 +2,7 @@ title: Controller Options linkTitle: Controller Options description: "Controller command flags and defaults." -weight: 1000 +weight: 1 --- To customise the controller options at install time, diff --git a/content/en/flux/components/source/.gitignore b/content/en/flux/components/source/.gitignore index e94c253f5..2c59c505b 100644 --- a/content/en/flux/components/source/.gitignore +++ b/content/en/flux/components/source/.gitignore @@ -1,4 +1,4 @@ -api.md +api/v*.md buckets.md gitrepositories.md helmcharts.md diff --git a/content/en/flux/components/source/api/_index.md b/content/en/flux/components/source/api/_index.md new file mode 100644 index 000000000..ea8b91346 --- /dev/null +++ b/content/en/flux/components/source/api/_index.md @@ -0,0 +1,5 @@ +--- +title: API Reference +linkTitle: API Reference +weight: 1000 +--- diff --git a/content/en/flux/components/source/options.md b/content/en/flux/components/source/options.md index 440686534..b187d2a40 100644 --- a/content/en/flux/components/source/options.md +++ b/content/en/flux/components/source/options.md @@ -2,7 +2,7 @@ title: Controller Options linkTitle: Controller Options description: "Controller command flags and defaults." -weight: 1000 +weight: 1 --- To customise the controller options at install time, diff --git a/hack/import-flux2-assets.sh b/hack/import-flux2-assets.sh index 3b411ecbe..2a2bdbd6e 100755 --- a/hack/import-flux2-assets.sh +++ b/hack/import-flux2-assets.sh @@ -94,6 +94,11 @@ gen_crd_doc() { exit 1 fi + WEIGHT="$(grep -E '^$' "$TMP" | cut -d' ' -f2|cut -d':' -f2)" + if [ -z "${WEIGHT}" ] ; then + WEIGHT=0 + fi + if [ -n "$TITLE" ]; then { echo "---" @@ -103,6 +108,7 @@ gen_crd_doc() { if [ -n "$HUGETABLE" ]; then echo "hugeTable: true" fi + echo "weight: $WEIGHT" echo "---" } >> "$DEST" grep -vE "^