Skip to content

Instantly share code, notes, and snippets.

@mtaufen
Created January 29, 2019 23:16
Show Gist options
  • Save mtaufen/3d958ce056e9af6bfb6d0f5955c14168 to your computer and use it in GitHub Desktop.
Save mtaufen/3d958ce056e9af6bfb6d0f5955c14168 to your computer and use it in GitHub Desktop.
shellcheck failures
Verifying verify-shellcheck.sh
+++ Running case: verify.shellcheck
+++ working dir: /home/prow/go/src/k8s.io/kubernetes
+++ command: bash "hack/make-rules/../../hack/verify-shellcheck.sh"
Using shellcheck 0.6.0 docker image.
Errors from shellcheck:
In ./cluster/gce/win1803/node-helper.sh line 49:
create-node-template "${template_name}" "${scope_flags[*]}" "$(get-windows-node-instance-metadata-from-file)" "$(get-windows-node-instance-metadata)" "windows"
^---------------^ SC2154: scope_flags is referenced but not assigned.
For more information:
https://www.shellcheck.net/wiki/SC2154 -- scope_flags is referenced but not...
In ./cluster/gce/win1803/smoke-test.sh line 64:
-o wide | egrep "Pending|windows" | wc -w)
^---^ SC2196: egrep is non-standard and deprecated. Use grep -E instead.
In ./cluster/gce/win1803/smoke-test.sh line 104:
if [[ $? -ne 0 ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
In ./cluster/gce/win1803/smoke-test.sh line 118:
let timeout=timeout-10
^--------------------^ SC2219: Instead of 'let expr', prefer (( expr )) .
In ./cluster/gce/win1803/smoke-test.sh line 180:
if [[ $? -ne 0 ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
In ./cluster/gce/win1803/smoke-test.sh line 194:
let timeout=timeout-10
^--------------------^ SC2219: Instead of 'let expr', prefer (( expr )) .
In ./cluster/gce/win1803/smoke-test.sh line 225:
local linux_command_pod="$(get_linux_command_pod_name)"
^---------------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 227:
$kubectl exec $linux_command_pod -- apt-get update > /dev/null
^----------------^ SC2086: Double quote to prevent globbing and word splitting.
In ./cluster/gce/win1803/smoke-test.sh line 228:
$kubectl exec $linux_command_pod -- \
^----------------^ SC2086: Double quote to prevent globbing and word splitting.
In ./cluster/gce/win1803/smoke-test.sh line 275:
if [[ $? -ne 0 ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
In ./cluster/gce/win1803/smoke-test.sh line 289:
let timeout=timeout-10
^--------------------^ SC2219: Instead of 'let expr', prefer (( expr )) .
In ./cluster/gce/win1803/smoke-test.sh line 353:
if [[ $? -ne 0 ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
In ./cluster/gce/win1803/smoke-test.sh line 367:
let timeout=timeout-10
^--------------------^ SC2219: Instead of 'let expr', prefer (( expr )) .
In ./cluster/gce/win1803/smoke-test.sh line 406:
local linux_command_pod="$(get_linux_command_pod_name)"
^---------------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 407:
local linux_webserver_pod_ip="$(get_linux_webserver_pod_ip)"
^--------------------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 409:
$kubectl exec $linux_command_pod -- curl -m 20 \
^----------------^ SC2086: Double quote to prevent globbing and word splitting.
In ./cluster/gce/win1803/smoke-test.sh line 410:
http://$linux_webserver_pod_ip &> $output_file
^---------------------^ SC2086: Double quote to prevent globbing and word splitting.
In ./cluster/gce/win1803/smoke-test.sh line 411:
if [[ $? -ne 0 ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
In ./cluster/gce/win1803/smoke-test.sh line 427:
local linux_command_pod="$(get_linux_command_pod_name)"
^---------------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 428:
local windows_webserver_pod_ip="$(get_windows_webserver_pod_ip)"
^----------------------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 430:
$kubectl exec $linux_command_pod -- curl -m 20 \
^----------------^ SC2086: Double quote to prevent globbing and word splitting.
In ./cluster/gce/win1803/smoke-test.sh line 431:
http://$windows_webserver_pod_ip:8080/read &> $output_file
^-----------------------^ SC2086: Double quote to prevent globbing and word splitting.
In ./cluster/gce/win1803/smoke-test.sh line 432:
if [[ $? -ne 0 ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
In ./cluster/gce/win1803/smoke-test.sh line 443:
local linux_command_pod="$(get_linux_command_pod_name)"
^---------------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 447:
$kubectl exec $linux_command_pod -- curl -m 20 \
^----------------^ SC2086: Double quote to prevent globbing and word splitting.
In ./cluster/gce/win1803/smoke-test.sh line 449:
if [[ $? -ne 0 ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
In ./cluster/gce/win1803/smoke-test.sh line 459:
local linux_command_pod="$(get_linux_command_pod_name)"
^---------------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 461:
local service_ip=$($kubectl get service --namespace kube-system $service \
^--------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 463:
local service_port=$($kubectl get service --namespace kube-system $service \
^----------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 469:
$kubectl exec $linux_command_pod -- \
^----------------^ SC2086: Double quote to prevent globbing and word splitting.
In ./cluster/gce/win1803/smoke-test.sh line 470:
curl -m 20 http://$service_ip:$service_port &> $output_file
^---------^ SC2086: Double quote to prevent globbing and word splitting.
^-----------^ SC2086: Double quote to prevent globbing and word splitting.
In ./cluster/gce/win1803/smoke-test.sh line 471:
if [[ $? -ne 0 ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
In ./cluster/gce/win1803/smoke-test.sh line 496:
local windows_command_pod="$(get_windows_command_pod_name)"
^-----------------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 497:
local linux_webserver_pod_ip="$(get_linux_webserver_pod_ip)"
^--------------------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 499:
$kubectl exec $windows_command_pod -- powershell.exe \
^------------------^ SC2086: Double quote to prevent globbing and word splitting.
In ./cluster/gce/win1803/smoke-test.sh line 501:
if [[ $? -ne 0 ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
In ./cluster/gce/win1803/smoke-test.sh line 511:
local windows_command_pod="$(get_windows_command_pod_name)"
^-----------------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 512:
local windows_webserver_pod_ip="$(get_windows_webserver_pod_ip)"
^----------------------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 514:
$kubectl exec $windows_command_pod -- powershell.exe \
^------------------^ SC2086: Double quote to prevent globbing and word splitting.
In ./cluster/gce/win1803/smoke-test.sh line 517:
if [[ $? -ne 0 ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
In ./cluster/gce/win1803/smoke-test.sh line 527:
local windows_command_pod="$(get_windows_command_pod_name)"
^-----------------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 534:
$kubectl exec $windows_command_pod -- powershell.exe \
^------------------^ SC2086: Double quote to prevent globbing and word splitting.
In ./cluster/gce/win1803/smoke-test.sh line 548:
if [[ $? -ne 0 ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
In ./cluster/gce/win1803/smoke-test.sh line 558:
local windows_command_pod="$(get_windows_command_pod_name)"
^-----------------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 560:
local service_ip=$($kubectl get service --namespace kube-system $service \
^--------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 562:
local service_port=$($kubectl get service --namespace kube-system $service \
^----------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 570:
$kubectl exec $windows_command_pod -- powershell.exe \
^------------------^ SC2086: Double quote to prevent globbing and word splitting.
In ./cluster/gce/win1803/smoke-test.sh line 584:
if [[ $? -ne 0 ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
In ./cluster/gce/win1803/smoke-test.sh line 594:
local windows_command_pod="$(get_windows_command_pod_name)"
^-----------------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 596:
local service_ip=$($kubectl get service --namespace kube-system $service \
^--------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 599:
$kubectl exec $windows_command_pod -- powershell.exe \
^------------------^ SC2086: Double quote to prevent globbing and word splitting.
In ./cluster/gce/win1803/smoke-test.sh line 601:
if [[ $? -ne 0 ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
In ./cluster/gce/win1803/smoke-test.sh line 611:
local windows_command_pod="$(get_windows_command_pod_name)"
^-----------------^ SC2155: Declare and assign separately to avoid masking return values.
In ./cluster/gce/win1803/smoke-test.sh line 613:
$kubectl exec $windows_command_pod -- powershell.exe \
^------------------^ SC2086: Double quote to prevent globbing and word splitting.
In ./cluster/gce/win1803/smoke-test.sh line 615:
if [[ $? -ne 0 ]]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
For more information:
https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ...
https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
https://www.shellcheck.net/wiki/SC2196 -- egrep is non-standard and depreca...
Please review the above warnings. You can test via "./hack/verify-shellcheck"
If the above warnings do not make sense, you can exempt this package from shellcheck
checking by adding it to hack/.shellcheck_failures (if your reviewer is okay with it).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment