Skip to content

Commit

Permalink
Get rid of deprecation warning for loglevel
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Franssen <marco.franssen@gmail.com>
  • Loading branch information
marcofranssen committed Jul 8, 2021
1 parent 43e553b commit 42eb1f9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions action.yml
Expand Up @@ -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"
Expand Down
14 changes: 7 additions & 7 deletions kind.sh
Expand Up @@ -31,7 +31,7 @@ Usage: $(basename "$0") <options>
-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
}
Expand All @@ -42,7 +42,7 @@ main() {
local node_image=
local cluster_name="$DEFAULT_CLUSTER_NAME"
local wait=60s
local log_level=
local verbosity=

parse_command_line "$@"

Expand Down Expand Up @@ -134,12 +134,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
Expand Down Expand Up @@ -183,8 +183,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[@]}"
Expand Down
4 changes: 2 additions & 2 deletions main.sh
Expand Up @@ -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[@]}"
Expand Down

0 comments on commit 42eb1f9

Please sign in to comment.