chore: fix shellcheck issues

This commit is contained in:
andyzhangx 2022-02-12 05:16:16 +00:00
parent 09e579235e
commit 143e068b9a
5 changed files with 11 additions and 10 deletions

View File

@ -1,3 +1,5 @@
#! /bin/bash
# Copyright 2020 The Kubernetes Authors. # Copyright 2020 The Kubernetes Authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
@ -12,8 +14,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
#! /bin/bash
# A Prow job can override these defaults, but this shouldn't be necessary. # A Prow job can override these defaults, but this shouldn't be necessary.
# Only these tests make sense for csi-driver-nfs until we can integrate k/k # Only these tests make sense for csi-driver-nfs until we can integrate k/k

View File

@ -32,14 +32,14 @@ function provision_nfs_server {
echo 'Installing NFS server on localhost' echo 'Installing NFS server on localhost'
apt-get update -y apt-get update -y
apt-get install -y nfs-common apt-get install -y nfs-common
docker run -d --name nfs --privileged -p 2049:2049 -v $(pwd)/nfsshare:/nfsshare -e SHARED_DIRECTORY=/nfsshare itsthenetwork/nfs-server-alpine:latest docker run -d --name nfs --privileged -p 2049:2049 -v "$(pwd)"/nfsshare:/nfsshare -e SHARED_DIRECTORY=/nfsshare itsthenetwork/nfs-server-alpine:latest
} }
provision_nfs_server provision_nfs_server
readonly CSC_BIN="$GOBIN/csc" readonly CSC_BIN="$GOBIN/csc"
readonly cap="1,mount," readonly cap="1,mount,"
readonly volname="citest-$(date +%s)" volname="citest-$(date +%s)"
readonly volsize="2147483648" readonly volsize="2147483648"
readonly endpoint="unix:///tmp/csi.sock" readonly endpoint="unix:///tmp/csi.sock"
readonly target_path="/tmp/targetpath" readonly target_path="/tmp/targetpath"
@ -70,6 +70,7 @@ echo "publish volume test:"
"$CSC_BIN" node publish --endpoint "$endpoint" --cap "$cap" --vol-context "$params" --target-path "$target_path" "$volumeid" "$CSC_BIN" node publish --endpoint "$endpoint" --cap "$cap" --vol-context "$params" --target-path "$target_path" "$volumeid"
sleep 2 sleep 2
declare staging_target_path
echo "node stats test:" echo "node stats test:"
csc node stats --endpoint "$endpoint" "$volumeid:$target_path:$staging_target_path" csc node stats --endpoint "$endpoint" "$volumeid:$target_path:$staging_target_path"
sleep 2 sleep 2

View File

@ -42,7 +42,7 @@ function provision_nfs_server {
echo 'Installing NFS server on localhost' echo 'Installing NFS server on localhost'
apt-get update -y apt-get update -y
apt-get install -y nfs-common apt-get install -y nfs-common
docker run -d --name nfs --privileged -p 2049:2049 -v $(pwd)/nfsshare:/nfsshare -e SHARED_DIRECTORY=/nfsshare itsthenetwork/nfs-server-alpine:latest docker run -d --name nfs --privileged -p 2049:2049 -v "$(pwd)"/nfsshare:/nfsshare -e SHARED_DIRECTORY=/nfsshare itsthenetwork/nfs-server-alpine:latest
} }
provision_nfs_server provision_nfs_server

View File

@ -1,3 +1,5 @@
#!/bin/bash
# Copyright 2020 The Kubernetes Authors. # Copyright 2020 The Kubernetes Authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
@ -12,8 +14,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
#!/bin/bash
set -e set -e
echo "check the driver pods if restarts ..." echo "check the driver pods if restarts ..."

View File

@ -1,3 +1,5 @@
#!/bin/bash
# Copyright 2020 The Kubernetes Authors. # Copyright 2020 The Kubernetes Authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
@ -12,8 +14,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
#!/bin/bash
set -e set -e
NS=kube-system NS=kube-system