From 88c3601e5944733997d8671dab5aab5281e05767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Tue, 14 Jan 2020 15:31:17 +0100 Subject: [PATCH 1/6] update kind to 0.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Bauer --- README.md | 5 +---- action.yml | 5 ++--- kind.sh | 18 ++++++++++++------ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 29b1228..7f1f976 100644 --- a/README.md +++ b/README.md @@ -15,14 +15,13 @@ For more information, reference the GitHub Help Documentation for [Creating a wo For more information on inputs, see the [API Documentation](https://developer.github.com/v3/repos/releases/#input) -- `version`: The kind version to use (default: `v0.6.1`) +- `version`: The kind version to use (default: `v0.7.0`) - `config`: The path to the kind config file - `node_image`: The Docker image for the cluster nodes - `cluster_name`: The name of the cluster to create (default: `chart-testing`) - `wait`: The duration to wait for the control plane to become ready (default: `60s`) - `log_level`: The log level for kind - `install_local_path_provisioner`: If true, Rancher's local-path provisioner is installed which supports dynamic volume provisioning on multi-node clusters. - The newly created local-path StorageClass is made the default. ### Example Workflow @@ -39,8 +38,6 @@ jobs: steps: - name: Create k8s Kind Cluster uses: helm/kind-action@v1.0.0-alpha.3 - with: - install_local_path_provisioner: true ``` This uses [@helm/kind-action](https://www.github.com/helm/kind-action) GitHub Action to spin up a [kind](https://kind.sigs.k8s.io/) Kubernetes cluster on every Pull Request. diff --git a/action.yml b/action.yml index 5198759..3d3dd09 100644 --- a/action.yml +++ b/action.yml @@ -6,7 +6,7 @@ branding: icon: box inputs: version: - description: "The kind version to use (default: v0.6.1)" + description: "The kind version to use (default: v0.7.0)" config: description: "The path to the kind config file" node_image: @@ -20,8 +20,7 @@ inputs: install_local_path_provisioner: description: | If true, Rancher's local-path provisioner is installed which supports - dynamic volume provisioning on multi-node clusters. The newly created - local-path StorageClass is made the default. + dynamic volume provisioning on multi-node clusters. runs: using: "node12" main: "main.js" diff --git a/kind.sh b/kind.sh index 48f0176..c086428 100755 --- a/kind.sh +++ b/kind.sh @@ -18,7 +18,7 @@ set -o errexit set -o nounset set -o pipefail -DEFAULT_KIND_VERSION=v0.6.1 +DEFAULT_KIND_VERSION=v0.7.0 DEFAULT_CLUSTER_NAME=chart-testing KUBECTL_VERSION=v1.17.0 @@ -27,15 +27,14 @@ cat << EOF Usage: $(basename "$0") -h, --help Display help - -v, --version The kind version to use (default: v0.6.1)" + -v, --version The kind version to use (default: v0.7.0)" -c, --config The path to the kind config file" -i, --node-image The Docker image for the cluster nodes" -n, --cluster-name The name of the cluster to create (default: chart-testing)" -w, --wait The duration to wait for the control plane to become ready (default: 60s)" -l, --log-level The log level for kind [panic, fatal, error, warning, info, debug, trace] (default: warning) -p, --install-local-path-provisioner If true, Rancher's local-path provisioner is installed which supports - dynamic volume provisioning on multi-node clusters. The newly created - local-path StorageClass is made the default. + dynamic volume provisioning on multi-node clusters. EOF } @@ -55,7 +54,7 @@ main() { install_kubectl create_kind_cluster - if [[ -n "$install_local_path_provisioner" ]]; then + if [[ "$install_local_path_provisioner" == "true" ]]; then install_local_path_provisioner fi } @@ -128,7 +127,14 @@ parse_command_line() { fi ;; -p|--install-local-path-provisioner) - install_local_path_provisioner=true + if [[ -n "${2:-}" ]]; then + install_local_path_provisioner="$2" + shift + else + echo "ERROR: '--install-local-path-provisioner' cannot be empty." >&2 + show_help + exit 1 + fi ;; *) break From 94ea55e4bde92d8d4b208bb6d586b1b44d43adc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Tue, 14 Jan 2020 15:52:20 +0100 Subject: [PATCH 2/6] removed whitespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Bauer --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 3d3dd09..cb7346b 100644 --- a/action.yml +++ b/action.yml @@ -20,7 +20,7 @@ inputs: install_local_path_provisioner: description: | If true, Rancher's local-path provisioner is installed which supports - dynamic volume provisioning on multi-node clusters. + dynamic volume provisioning on multi-node clusters. runs: using: "node12" main: "main.js" From 71bcb7ed5235c879b52dbe7f3265a0386f5dc539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Wed, 15 Jan 2020 12:33:10 +0100 Subject: [PATCH 3/6] removed install-local-path-provisioner from test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Bauer --- .github/workflows/test.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 58cd5de..5e06888 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,8 +16,6 @@ jobs: - name: Create kind cluster uses: ./ - with: - install_local_path_provisioner: true - name: Test run: | From 1d097dbe56e1e7e8fa5f2955b9c476e801a96e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Wed, 15 Jan 2020 12:48:04 +0100 Subject: [PATCH 4/6] removed get storageclass from test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Bauer --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5e06888..8f8f0a3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,4 +20,4 @@ jobs: - name: Test run: | kubectl cluster-info - kubectl get storageclass local-path + From 3164897df4378b0d3a955d9e55f54648bdd6ede8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Wed, 22 Jan 2020 15:33:47 +0100 Subject: [PATCH 5/6] added test for standard storageclass instead of local-path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Bauer --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8f8f0a3..7f95c87 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,4 +20,4 @@ jobs: - name: Test run: | kubectl cluster-info - + kubectl get storageclass standard From db5b8a4f52fb8d0cf065fb87101706b3ba94bc9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Fri, 7 Feb 2020 11:45:36 +0100 Subject: [PATCH 6/6] removed local path provisioner install entirely MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Bauer --- README.md | 1 - action.yml | 4 ---- kind.sh | 30 ------------------------------ main.sh | 4 ---- 4 files changed, 39 deletions(-) diff --git a/README.md b/README.md index 7f1f976..49f9d76 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,6 @@ For more information on inputs, see the [API Documentation](https://developer.gi - `cluster_name`: The name of the cluster to create (default: `chart-testing`) - `wait`: The duration to wait for the control plane to become ready (default: `60s`) - `log_level`: The log level for kind -- `install_local_path_provisioner`: If true, Rancher's local-path provisioner is installed which supports dynamic volume provisioning on multi-node clusters. ### Example Workflow diff --git a/action.yml b/action.yml index cb7346b..c154af4 100644 --- a/action.yml +++ b/action.yml @@ -17,10 +17,6 @@ inputs: description: "The duration to wait for the control plane to become ready (default: 60s)" log_level: description: "The log level for kind" - install_local_path_provisioner: - description: | - If true, Rancher's local-path provisioner is installed which supports - dynamic volume provisioning on multi-node clusters. runs: using: "node12" main: "main.js" diff --git a/kind.sh b/kind.sh index c086428..b811c1d 100755 --- a/kind.sh +++ b/kind.sh @@ -33,8 +33,6 @@ Usage: $(basename "$0") -n, --cluster-name The name of the cluster to create (default: chart-testing)" -w, --wait The duration to wait for the control plane to become ready (default: 60s)" -l, --log-level The log level for kind [panic, fatal, error, warning, info, debug, trace] (default: warning) - -p, --install-local-path-provisioner If true, Rancher's local-path provisioner is installed which supports - dynamic volume provisioning on multi-node clusters. EOF } @@ -46,7 +44,6 @@ main() { local cluster_name="$DEFAULT_CLUSTER_NAME" local wait=60s local log_level= - local install_local_path_provisioner= parse_command_line "$@" @@ -54,9 +51,6 @@ main() { install_kubectl create_kind_cluster - if [[ "$install_local_path_provisioner" == "true" ]]; then - install_local_path_provisioner - fi } parse_command_line() { @@ -126,16 +120,6 @@ parse_command_line() { exit 1 fi ;; - -p|--install-local-path-provisioner) - if [[ -n "${2:-}" ]]; then - install_local_path_provisioner="$2" - shift - else - echo "ERROR: '--install-local-path-provisioner' cannot be empty." >&2 - show_help - exit 1 - fi - ;; *) break ;; @@ -178,18 +162,4 @@ create_kind_cluster() { kind "${args[@]}" } -install_local_path_provisioner() { - echo 'Installing local-path provisioner...' - kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml - - echo 'Changing default StorageClass...' - kubectl patch storageclass standard --patch '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "false"}}}' - kubectl patch storageclass standard --patch '{"metadata": {"annotations": {"storageclass.beta.kubernetes.io/is-default-class": "false"}}}' - kubectl patch storageclass local-path --patch '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "true"}}}' - kubectl patch storageclass local-path --patch '{"metadata": {"annotations": {"storageclass.beta.kubernetes.io/is-default-class": "true"}}}' - - echo 'Available StorageClasses:' - kubectl get storageclasses -} - main "$@" diff --git a/main.sh b/main.sh index 08ac44a..7aec785 100755 --- a/main.sh +++ b/main.sh @@ -47,10 +47,6 @@ main() { args+=(--log-level "${INPUT_LOG_LEVEL}") fi - if [[ -n "${INPUT_INSTALL_LOCAL_PATH_PROVISIONER:-}" ]]; then - args+=(--install-local-path-provisioner) - fi - "$SCRIPT_DIR/kind.sh" "${args[@]}" }