Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve deprecation warning #40

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -17,10 +17,10 @@ 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
- `verbosity`: The verbosity level for kind (`int32`)

### Example Workflow

Expand Down
6 changes: 3 additions & 3 deletions action.yml
Expand Up @@ -10,13 +10,13 @@ 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:
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
17 changes: 9 additions & 8 deletions kind.sh
Expand Up @@ -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
Expand All @@ -32,18 +33,18 @@ 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
}

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=
local verbosity=

parse_command_line "$@"

Expand Down Expand Up @@ -135,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
Expand Down Expand Up @@ -184,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[@]}"
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