bazelbuild / rules_k8s

This repository contains rules for interacting with Kubernetes configurations / clusters.
Apache License 2.0
290 stars 137 forks source link

Fix shellcheck warnings in our bash scripts #199

Open chrislovecnm opened 6 years ago

chrislovecnm commented 6 years ago

we are getting a bunch of warnings.

$ find . -type f | grep sh$ | xargs shellcheck

In ./examples/hellohttp/e2e-test.sh line 23:
  echo "Usage: $(basename $0) <language ...>"
                          ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellohttp/e2e-test.sh line 27:
    kubectl --namespace=${USER} get service hello-http-staging \
                        ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellohttp/e2e-test.sh line 38:
   OUTPUT=$(curl http://$(get_lb_ip):8080)
                        ^-- SC2046: Quote this to prevent word splitting.

In ./examples/hellohttp/e2e-test.sh line 44:
  echo Setting $LANGUAGE to "$1"
               ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellohttp/e2e-test.sh line 45:
  ./examples/hellohttp/${LANGUAGE}/edit.sh "$1"
                       ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellohttp/e2e-test.sh line 49:
  echo Applying $LANGUAGE...
                ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellohttp/e2e-test.sh line 50:
  bazel run examples/hellohttp/${LANGUAGE}:staging.apply
                               ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellohttp/e2e-test.sh line 54:
  echo Deleting $LANGUAGE...
                ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellohttp/e2e-test.sh line 56:
  bazel run examples/hellohttp/${LANGUAGE}:staging.describe
                               ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellohttp/e2e-test.sh line 57:
  bazel run examples/hellohttp/${LANGUAGE}:staging.delete
                               ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 23:
  echo "Usage: $(basename $0) <language ...>"
                          ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 27:
  kubectl --namespace=${USER} get service hello-grpc-staging \
                      ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 39:
  echo Creating $LANGUAGE...
                ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 40:
  bazel build examples/hellogrpc/${LANGUAGE}/server:staging.create
                                 ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 41:
  bazel-bin/examples/hellogrpc/${LANGUAGE}/server/staging.create
                               ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 45:
  bazel build examples/hellogrpc/${LANGUAGE}/client
                                 ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 47:
  OUTPUT=$(./bazel-bin/examples/hellogrpc/${LANGUAGE}/client/client $(get_lb_ip))
                                          ^-- SC2086: Double quote to prevent globbing and word splitting.
                                                                    ^-- SC2046: Quote this to prevent word splitting.

In ./examples/hellogrpc/e2e-test.sh line 53:
  echo Setting $LANGUAGE to "$1"
               ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 54:
  ./examples/hellogrpc/${LANGUAGE}/server/edit.sh "$1"
                       ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 58:
  echo Updating $LANGUAGE...
                ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 59:
  bazel build examples/hellogrpc/${LANGUAGE}/server:staging.replace
                                 ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 60:
  bazel-bin/examples/hellogrpc/${LANGUAGE}/server/staging.replace
                               ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 64:
  echo Deleting $LANGUAGE...
                ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 66:
  bazel build examples/hellogrpc/${LANGUAGE}/server:staging.describe
                                 ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 67:
  bazel-bin/examples/hellogrpc/${LANGUAGE}/server/staging.describe
                               ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 68:
  bazel build examples/hellogrpc/${LANGUAGE}/server:staging.delete
                                 ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/hellogrpc/e2e-test.sh line 69:
  bazel-bin/examples/hellogrpc/${LANGUAGE}/server/staging.delete
                               ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/todocontroller/e2e-test.sh line 21:
  kubectl --namespace=${USER} get service hello-grpc-staging \
                      ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/todocontroller/e2e-test.sh line 26:
  echo Creating $LANGUAGE...
                ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/todocontroller/e2e-test.sh line 27:
  bazel build examples/todocontroller/${LANGUAGE}:staging.create
                                      ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/todocontroller/e2e-test.sh line 28:
  bazel-bin/examples/todocontroller/${LANGUAGE}/staging.create
                                    ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/todocontroller/e2e-test.sh line 42:
  echo Editing $LANGUAGE to $1...
               ^-- SC2086: Double quote to prevent globbing and word splitting.
                            ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/todocontroller/e2e-test.sh line 43:
  ./examples/todocontroller/${LANGUAGE}/edit.sh "$1"
                            ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/todocontroller/e2e-test.sh line 47:
  echo Replacing $LANGUAGE controller...
                 ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/todocontroller/e2e-test.sh line 48:
  bazel build examples/todocontroller/${LANGUAGE}:controller-deployment.replace
                                      ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/todocontroller/e2e-test.sh line 49:
  bazel-bin/examples/todocontroller/${LANGUAGE}/controller-deployment.replace
                                    ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/todocontroller/e2e-test.sh line 59:
  echo Deleting $LANGUAGE...
                ^-- SC2086: Double quote to prevent globbing and word splitting.

In ./examples/todocontroller/e2e-test.sh line 61:
  bazel run examples/todocontroller/${LANGUAGE}:controller-deployment.describe
                                    ^-- SC2086: Double quote to prevent globbing and word splitting.
chrislovecnm commented 6 years ago

I am working on a PR ...