From 01c60e84495414626e29348cc435624b270a1681 Mon Sep 17 00:00:00 2001 From: Marco Franssen Date: Thu, 24 Jun 2021 13:10:29 +0200 Subject: [PATCH 1/2] Set default node_image to 1.20.7 Aligned with the kubectl version Signed-off-by: Marco Franssen --- README.md | 2 +- action.yml | 2 +- kind.sh | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ce324cd..a204622 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ For more information on inputs, see the [API Documentation](https://developer.gi - `version`: The kind version to use (default: `v0.11.1`) - `config`: The path to the kind config file -- `node_image`: The Docker image for the cluster nodes +- `node_image`: The Docker image for the cluster nodes (default: `v1.20.7`) - `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 diff --git a/action.yml b/action.yml index b056b5e..4857cf0 100644 --- a/action.yml +++ b/action.yml @@ -10,7 +10,7 @@ inputs: config: description: "The path to the kind config file" node_image: - description: "The Docker image for the cluster nodes" + description: "The Docker image for the cluster nodes (default: v1.20.7)" cluster_name: description: "The name of the cluster to create (default: chart-testing)" wait: diff --git a/kind.sh b/kind.sh index f4effd3..9d453cc 100755 --- a/kind.sh +++ b/kind.sh @@ -21,6 +21,7 @@ set -o pipefail DEFAULT_KIND_VERSION=v0.11.1 DEFAULT_CLUSTER_NAME=chart-testing KUBECTL_VERSION=v1.20.8 +DEFAULT_NODE_IMAGE=v1.20.7 show_help() { cat << EOF @@ -40,7 +41,7 @@ EOF main() { local version="$DEFAULT_KIND_VERSION" local config= - local node_image= + local node_image="$DEFAULT_NODE_IMAGE" local cluster_name="$DEFAULT_CLUSTER_NAME" local wait=60s local log_level= From 397ad09f8fc1543e00a3e2fa81d372c152e0e411 Mon Sep 17 00:00:00 2001 From: Marco Franssen Date: Thu, 24 Jun 2021 13:16:32 +0200 Subject: [PATCH 2/2] Get rid of deprecation warning for loglevel Signed-off-by: Marco Franssen --- README.md | 2 +- action.yml | 4 ++-- kind.sh | 14 +++++++------- main.sh | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a204622..5b651bc 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ For more information on inputs, see the [API Documentation](https://developer.gi - `node_image`: The Docker image for the cluster nodes (default: `v1.20.7`) - `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 +- `verbosity`: The verbosity level for kind (`int32`) ### Example Workflow diff --git a/action.yml b/action.yml index 4857cf0..4b71837 100644 --- a/action.yml +++ b/action.yml @@ -15,8 +15,8 @@ inputs: description: "The name of the cluster to create (default: chart-testing)" wait: description: "The duration to wait for the control plane to become ready (default: 60s)" - log_level: - description: "The log level for kind" + verbosity: + description: "The verbosity level for kind" runs: using: "node12" main: "main.js" diff --git a/kind.sh b/kind.sh index 9d453cc..d46a520 100755 --- a/kind.sh +++ b/kind.sh @@ -33,7 +33,7 @@ Usage: $(basename "$0") -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) + -v The verbosity level for kind (int32) EOF } @@ -44,7 +44,7 @@ main() { local node_image="$DEFAULT_NODE_IMAGE" local cluster_name="$DEFAULT_CLUSTER_NAME" local wait=60s - local log_level= + local verbosity= parse_command_line "$@" @@ -136,12 +136,12 @@ parse_command_line() { exit 1 fi ;; - -l|--log-level) + -v) if [[ -n "${2:-}" ]]; then - log_level="$2" + verbosity="$2" shift else - echo "ERROR: '--log-level' cannot be empty." >&2 + echo "ERROR: '-v' cannot be empty." >&2 show_help exit 1 fi @@ -185,8 +185,8 @@ create_kind_cluster() { args+=("--config=$config") fi - if [[ -n "$log_level" ]]; then - args+=("--loglevel=$log_level") + if [[ -n "$verbosity" ]]; then + args+=("-v=$verbosity") fi "$kind_dir/kind" "${args[@]}" diff --git a/main.sh b/main.sh index 7aec785..c86ccbb 100755 --- a/main.sh +++ b/main.sh @@ -43,8 +43,8 @@ main() { args+=(--wait "${INPUT_WAIT}") fi - if [[ -n "${INPUT_LOG_LEVEL:-}" ]]; then - args+=(--log-level "${INPUT_LOG_LEVEL}") + if [[ -n "${INPUT_VERBOSITY:-}" ]]; then + args+=(-v "${INPUT_VERBOSITY}") fi "$SCRIPT_DIR/kind.sh" "${args[@]}"