diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..6466c09e --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,15 @@ +# GitHub Action to automate the identification of common misspellings in text files. +# https://github.com/codespell-project/actions-codespell +# https://github.com/codespell-project/codespell +name: codespell +on: [push, pull_request] +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: codespell-project/actions-codespell@master + with: + check_filenames: true + skip: ./.git,./.github/workflows/codespell.yml,.git,*.png,*.jpg,*.svg,*.sum,./vendor,go.sum,./release-tools/prow.sh diff --git a/.github/workflows/shellcheck.yaml b/.github/workflows/shellcheck.yaml new file mode 100644 index 00000000..40ed2ce0 --- /dev/null +++ b/.github/workflows/shellcheck.yaml @@ -0,0 +1,29 @@ +name: ShellCheck +on: + push: + tags: + - v* + branches: + - master + - release-* + pull_request: + branches: + - master + - release-* + +jobs: + shellcheck: + name: Shellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@master + env: + SHELLCHECK_OPTS: -e SC2034 + with: + severity: warning + check_together: 'yes' + disable_matcher: false + ignore_paths: vendor release-tools hack + format: gcc diff --git a/.prow.sh b/.prow.sh index 00bd8e31..3ec03d0f 100755 --- a/.prow.sh +++ b/.prow.sh @@ -1,3 +1,5 @@ +#! /bin/bash + # Copyright 2020 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -#! /bin/bash - # 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 diff --git a/docs/csi-debug.md b/docs/csi-debug.md index b44f2267..90bffbc3 100644 --- a/docs/csi-debug.md +++ b/docs/csi-debug.md @@ -15,7 +15,7 @@ $ kubectl logs csi-nfs-controller-56bfddd689-dh5tk -c nfs -n kube-system > csi-n > note: there could be multiple controller pods, if there are no helpful logs, try to get logs from other controller pods ### Case#2: volume mount/unmount failed - - locate csi driver pod and figure out which pod does tha actual volume mount/unmount + - locate csi driver pod that does the actual volume mount/unmount ```console $ kubectl get pod -o wide -n kube-system | grep csi-nfs-node diff --git a/test/e2e/testsuites/dynamically_provisioned_reclaim_policy_tester.go b/test/e2e/testsuites/dynamically_provisioned_reclaim_policy_tester.go index 0d68d174..13982263 100644 --- a/test/e2e/testsuites/dynamically_provisioned_reclaim_policy_tester.go +++ b/test/e2e/testsuites/dynamically_provisioned_reclaim_policy_tester.go @@ -44,7 +44,7 @@ func (t *DynamicallyProvisionedReclaimPolicyTest) Run(client clientset.Interface if tpvc.ReclaimPolicy() == v1.PersistentVolumeReclaimRetain { tpvc.WaitForPersistentVolumePhase(v1.VolumeReleased) tpvc.DeleteBoundPersistentVolume() - // The controler server cannot resolve the nfs server hosting inside the testing k8s cluster, skipping the cleanup step. + // The controller server cannot resolve the nfs server hosting inside the testing k8s cluster, skipping the cleanup step. // tpvc.DeleteBackingVolume(&t.ControllerServer) } } diff --git a/test/e2e/testsuites/testsuites.go b/test/e2e/testsuites/testsuites.go index 321e99ca..eab6a800 100644 --- a/test/e2e/testsuites/testsuites.go +++ b/test/e2e/testsuites/testsuites.go @@ -67,7 +67,7 @@ var podFailedCondition = func(pod *v1.Pod) (bool, error) { ginkgo.By("Saw pod failure") return true, nil case v1.PodSucceeded: - return true, fmt.Errorf("pod %q successed with reason: %q, message: %q", pod.Name, pod.Status.Reason, pod.Status.Message) + return true, fmt.Errorf("pod %q succeeded with reason: %q, message: %q", pod.Name, pod.Status.Reason, pod.Status.Message) default: return false, nil } diff --git a/test/integration/run-test.sh b/test/integration/run-test.sh index 5dd6bfb6..3760b3ec 100755 --- a/test/integration/run-test.sh +++ b/test/integration/run-test.sh @@ -32,14 +32,14 @@ function provision_nfs_server { echo 'Installing NFS server on localhost' apt-get update -y 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 readonly CSC_BIN="$GOBIN/csc" readonly cap="1,mount," -readonly volname="citest-$(date +%s)" +volname="citest-$(date +%s)" readonly volsize="2147483648" readonly endpoint="unix:///tmp/csi.sock" 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" sleep 2 +declare staging_target_path echo "node stats test:" csc node stats --endpoint "$endpoint" "$volumeid:$target_path:$staging_target_path" sleep 2 diff --git a/test/sanity/run-test.sh b/test/sanity/run-test.sh index 9ebf1e9f..012ab0a0 100755 --- a/test/sanity/run-test.sh +++ b/test/sanity/run-test.sh @@ -42,7 +42,7 @@ function provision_nfs_server { echo 'Installing NFS server on localhost' apt-get update -y 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 diff --git a/test/utils/check_driver_pods_restart.sh b/test/utils/check_driver_pods_restart.sh index f9df9fcd..71c53a9c 100644 --- a/test/utils/check_driver_pods_restart.sh +++ b/test/utils/check_driver_pods_restart.sh @@ -1,3 +1,5 @@ +#!/bin/bash + # Copyright 2020 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash - set -e echo "check the driver pods if restarts ..." @@ -28,4 +28,4 @@ do fi done echo "no driver pods have restarted" -echo "======================================================================================" \ No newline at end of file +echo "======================================================================================" diff --git a/test/utils/nfs_log.sh b/test/utils/nfs_log.sh index 18a70af4..0260810d 100644 --- a/test/utils/nfs_log.sh +++ b/test/utils/nfs_log.sh @@ -1,3 +1,5 @@ +#!/bin/bash + # Copyright 2020 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash - set -e NS=kube-system