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 --log-level deprecation #57

Closed
wants to merge 1 commit 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
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
- `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
- `kubectl_version`: The kubectl version to use (default: v1.20.8)

### Example Workflow
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
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"
kubectl_version:
description: "The kubectl version to use (default: v1.20.8)"
runs:
Expand Down
14 changes: 7 additions & 7 deletions kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,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, --verbosity The log level for kind [panic, fatal, error, warning, info, debug, trace] (default: warning)
-k, --kubectl-version The kubectl version to use (default: $DEFAULT_KUBECTL_VERSION)"

EOF
Expand All @@ -44,7 +44,7 @@ main() {
local node_image=
local cluster_name="$DEFAULT_CLUSTER_NAME"
local wait=60s
local log_level=
local verbosity=
local kubectl_version="$DEFAULT_KUBECTL_VERSION"

parse_command_line "$@"
Expand Down Expand Up @@ -137,12 +137,12 @@ parse_command_line() {
exit 1
fi
;;
-l|--log-level)
-v|--verbosity)
if [[ -n "${2:-}" ]]; then
log_level="$2"
verbosity="$2"
shift
else
echo "ERROR: '--log-level' cannot be empty." >&2
echo "ERROR: '--verbosity' cannot be empty." >&2
show_help
exit 1
fi
Expand Down Expand Up @@ -196,8 +196,8 @@ create_kind_cluster() {
args+=("--config=$config")
fi

if [[ -n "$log_level" ]]; then
args+=("--loglevel=$log_level")
if [[ -n "$verbosity" ]]; then
args+=("--loglevel=$verbosity")
fi

"$kind_dir/kind" "${args[@]}"
Expand Down
4 changes: 2 additions & 2 deletions main.sh
Original file line number Diff line number Diff line change
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+=(--verbosity "${INPUT_VERBOSITY}")
fi

if [[ -n "${INPUT_KUBECTL_VERSION:-}" ]]; then
Expand Down