From 5733241f7a77de627fd08cb3de7757d18482cb2b Mon Sep 17 00:00:00 2001 From: danielqsj Date: Mon, 11 Feb 2019 16:45:12 +0800 Subject: [PATCH 1/4] fix shellcheck in plugin/pkg/admission/imagepolicy/gencerts.sh --- hack/.shellcheck_failures | 1 - plugin/pkg/admission/imagepolicy/gencerts.sh | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/hack/.shellcheck_failures b/hack/.shellcheck_failures index 1e1b0914d1..fb2d2ab948 100644 --- a/hack/.shellcheck_failures +++ b/hack/.shellcheck_failures @@ -121,7 +121,6 @@ ./hack/verify-typecheck.sh ./pkg/kubectl/cmd/edit/testdata/record_testcase.sh ./pkg/util/verify-util-pkg.sh -./plugin/pkg/admission/imagepolicy/gencerts.sh ./test/cmd/apply.sh ./test/cmd/apps.sh ./test/cmd/authorization.sh diff --git a/plugin/pkg/admission/imagepolicy/gencerts.sh b/plugin/pkg/admission/imagepolicy/gencerts.sh index 30304922d8..267aceffa7 100755 --- a/plugin/pkg/admission/imagepolicy/gencerts.sh +++ b/plugin/pkg/admission/imagepolicy/gencerts.sh @@ -83,12 +83,12 @@ See the License for the specific language governing permissions and limitations under the License. */ +// This file was generated using openssl by the gencerts.sh script +// and holds raw certificates for the imagepolicy webhook tests. + +package imagepolic EOF -echo "// This file was generated using openssl by the gencerts.sh script" >> $outfile -echo "// and holds raw certificates for the imagepolicy webhook tests." >> $outfile -echo "" >> $outfile -echo "package imagepolicy" >> $outfile for file in caKey caCert badCAKey badCACert serverKey serverCert clientKey clientCert; do data=$(cat ${file}.pem) echo "" >> $outfile @@ -96,7 +96,7 @@ for file in caKey caCert badCAKey badCACert serverKey serverCert clientKey clien done # Clean up after we're done. -rm *.pem -rm *.csr -rm *.srl -rm *.conf +rm ./*.pem +rm ./*.csr +rm ./*.srl +rm ./*.conf From 0e78dd2d17b0fe314780005d6e06a21822fb34ff Mon Sep 17 00:00:00 2001 From: danielqsj Date: Mon, 11 Feb 2019 16:47:12 +0800 Subject: [PATCH 2/4] fix shellcheck in pkg/util/verify-util-pkg.sh --- hack/.shellcheck_failures | 1 - pkg/util/verify-util-pkg.sh | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hack/.shellcheck_failures b/hack/.shellcheck_failures index fb2d2ab948..d1538e293a 100644 --- a/hack/.shellcheck_failures +++ b/hack/.shellcheck_failures @@ -120,7 +120,6 @@ ./hack/verify-test-owners.sh ./hack/verify-typecheck.sh ./pkg/kubectl/cmd/edit/testdata/record_testcase.sh -./pkg/util/verify-util-pkg.sh ./test/cmd/apply.sh ./test/cmd/apps.sh ./test/cmd/authorization.sh diff --git a/pkg/util/verify-util-pkg.sh b/pkg/util/verify-util-pkg.sh index 5c1fbecc71..92f4dedd1f 100755 --- a/pkg/util/verify-util-pkg.sh +++ b/pkg/util/verify-util-pkg.sh @@ -21,7 +21,7 @@ set -o errexit set -o nounset set -o pipefail -BASH_DIR=$(dirname "${BASH_SOURCE}") +BASH_DIR=$(dirname "${BASH_SOURCE[0]}") find_go_files() { find . -maxdepth 1 -not \( \ @@ -34,8 +34,8 @@ find_go_files() { ret=0 pushd "${BASH_DIR}" > /dev/null - for path in `find_go_files`; do - file=$(basename $path) + for path in $(find_go_files); do + file=$(basename "$path") echo "Found pkg/util/${file}, but should be moved into util sub-pkgs." 1>&2 ret=1 done From 998147de59c6c11d3d968990810d7ec69c07f7f8 Mon Sep 17 00:00:00 2001 From: danielqsj Date: Mon, 11 Feb 2019 16:50:19 +0800 Subject: [PATCH 3/4] fix shellcheck in pkg/kubectl/cmd/edit/testdata/record_testcase.sh --- hack/.shellcheck_failures | 1 - pkg/kubectl/cmd/edit/testdata/record_testcase.sh | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hack/.shellcheck_failures b/hack/.shellcheck_failures index d1538e293a..c3c767f27a 100644 --- a/hack/.shellcheck_failures +++ b/hack/.shellcheck_failures @@ -119,7 +119,6 @@ ./hack/verify-test-images.sh ./hack/verify-test-owners.sh ./hack/verify-typecheck.sh -./pkg/kubectl/cmd/edit/testdata/record_testcase.sh ./test/cmd/apply.sh ./test/cmd/apps.sh ./test/cmd/authorization.sh diff --git a/pkg/kubectl/cmd/edit/testdata/record_testcase.sh b/pkg/kubectl/cmd/edit/testdata/record_testcase.sh index c7685c4d3b..541d98175b 100755 --- a/pkg/kubectl/cmd/edit/testdata/record_testcase.sh +++ b/pkg/kubectl/cmd/edit/testdata/record_testcase.sh @@ -25,7 +25,7 @@ fi # Clean up the test server function cleanup { - if [[ ! -z "${pid-}" ]]; then + if [[ -n "${pid-}" ]]; then echo "Stopping recording server (${pid})" # kill the process `go run` launched pkill -P "${pid}" @@ -36,7 +36,7 @@ function cleanup { testcase="${1}" -test_root="$(dirname "${BASH_SOURCE}")" +test_root="$(dirname "${BASH_SOURCE[0]}")" testcase_dir="${test_root}/testcase-${testcase}" mkdir -p "${testcase_dir}" From 3c9ba7f298345bce9384b50792de53f2fa6163f4 Mon Sep 17 00:00:00 2001 From: danielqsj Date: Fri, 22 Feb 2019 22:38:48 +0800 Subject: [PATCH 4/4] fix typo --- plugin/pkg/admission/imagepolicy/gencerts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/pkg/admission/imagepolicy/gencerts.sh b/plugin/pkg/admission/imagepolicy/gencerts.sh index 267aceffa7..46e0ea858a 100755 --- a/plugin/pkg/admission/imagepolicy/gencerts.sh +++ b/plugin/pkg/admission/imagepolicy/gencerts.sh @@ -86,7 +86,7 @@ limitations under the License. // This file was generated using openssl by the gencerts.sh script // and holds raw certificates for the imagepolicy webhook tests. -package imagepolic +package imagepolicy EOF for file in caKey caCert badCAKey badCACert serverKey serverCert clientKey clientCert; do