Merge pull request #420 from andyzhangx/codespell

test: add codespell shellcheck github actions
This commit is contained in:
Andy Zhang 2022-02-15 17:31:04 +08:00 committed by GitHub
commit 40a49e9a5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 66 additions and 20 deletions

16
.github/workflows/codespell.yml vendored Normal file
View File

@ -0,0 +1,16 @@
# 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
ignore_words_list: browseable

29
.github/workflows/shellcheck.yaml vendored Normal file
View File

@ -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

View File

@ -15,7 +15,7 @@ $ kubectl logs csi-smb-controller-56bfddd689-dh5tk -c smb -n kube-system > csi-s
> 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 make sure which pod do tha actual volume mount/unmount
- locate csi driver pod that does the actual volume mount/unmount
```console
$ kubectl get po -o wide -n kube-system | grep csi-smb-node
NAME READY STATUS RESTARTS AGE IP NODE

View File

@ -4,7 +4,7 @@
- error details:
```
FailedMount: MountVolume.MountDevice failed for volume "pvc-2ca92cca-c690-4fea-842f-0a4d32e97f5a" : rpc error: code = Internal desc = volume(pvc-2ca92cca-c690-4fea-842f-0a4d32e97f5a) mount "\\\\40.64.101.43\\share" on "\\var\\lib\\kubelet\\plugins\\kubernetes.io\\csi\\pv\\pvc-2ca92cca-c690-4fea-842f-0a4d32e97f5a\\globalmount" failed with smb mapping failed with error: rpc error: code = Unknown desc = NewSmbGlobalMapping failed. output: "New-SmbGlobalMapping : A specified logon session does not exist. It may already have been terminated. \r\nAt line:1 char:190\r\n+ ... ser, $PWord;New-SmbGlobalMapping -RemotePath $Env:smbremotepath -Cred ...\r\n+
FailedMount: MountVolume.MountDevice failed for volume "pvc-2ca92cca-c690-4fea-842f-0a4d32e97f5a" : rpc error: code = Internal desc = volume(pvc-2ca92cca-c690-4fea-842f-0a4d32e97f5a) mount "\\\\40.64.101.43\\share" on "\\var\\lib\\kubelet\\plugins\\kubernetes.io\\csi\\pv\\pvc-2ca92cca-c690-4fea-842f-0a4d32e97f5a\\globalmount" failed with smb mapping failed with error: rpc error: code = Unknown desc = NewSmbGlobalMapping failed. output: "New-SmbGlobalMapping : A specified logon session does not exist. It may already have been terminated. \r\nAt line:1 char:190\r\n+ ... , $PWord;New-SmbGlobalMapping -RemotePath $Env:smbremotepath -Cred ...\r\n+
```
- Workaround
@ -14,7 +14,7 @@ FailedMount: MountVolume.MountDevice failed for volume "pvc-2ca92cca-c690-4fea-8
- error details:
```
MountVolume.MountDevice failed for volume "pvc-1efb71f1-ab8a-4bbf-8db7-84a8e58877b4" : rpc error: code = Internal desc = volume(pvc-1efb71f1-ab8a-4bbf-8db7-84a8e58877b4) mount "//docp-smb1/smbservice" on "\var\lib\kubelet\plugins\kubernetes.io\csi\pv\pvc-1efb71f1-ab8a-4bbf-8db7-84a8e58877b4\globalmount" failed with smb mapping failed with error: rpc error: code = Unknown desc = NewSmbGlobalMapping failed. output: "New-SmbGlobalMapping : Multiple connections to a server or shared resource by the same user, using more than one user \r\nname, are not allowed. Disconnect all previous connections to the server or shared resource and try again. \r\nAt line:1 char:190\r\n+ ... ser, $PWord;New-SmbGlobalMapping -RemotePath $Env:smbremotepath -Cred ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : NotSpecified: (MSFT_SmbGlobalMapping:ROOT/Microsoft/...mbGlobalMapping) [New-SmbGlobalMa \r\n pping], CimException\r\n + FullyQualifiedErrorId : Windows System Error 1219,New-SmbGlobalMapping\r\n \r\n", err: exit status 1
MountVolume.MountDevice failed for volume "pvc-1efb71f1-ab8a-4bbf-8db7-84a8e58877b4" : rpc error: code = Internal desc = volume(pvc-1efb71f1-ab8a-4bbf-8db7-84a8e58877b4) mount "//docp-smb1/smbservice" on "\var\lib\kubelet\plugins\kubernetes.io\csi\pv\pvc-1efb71f1-ab8a-4bbf-8db7-84a8e58877b4\globalmount" failed with smb mapping failed with error: rpc error: code = Unknown desc = NewSmbGlobalMapping failed. output: "New-SmbGlobalMapping : Multiple connections to a server or shared resource by the same user, using more than one user \r\nname, are not allowed. Disconnect all previous connections to the server or shared resource and try again. \r\nAt line:1 char:190\r\n+ ... , $PWord;New-SmbGlobalMapping -RemotePath $Env:smbremotepath -Cred ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : NotSpecified: (MSFT_SmbGlobalMapping:ROOT/Microsoft/...mbGlobalMapping) [New-SmbGlobalMa \r\n pping], CimException\r\n + FullyQualifiedErrorId : Windows System Error 1219,New-SmbGlobalMapping\r\n \r\n", err: exit status 1
```
- Workaround
@ -25,4 +25,4 @@ I will add notion in the windows example doc, there is no fix for this issue cur
- Mitigation if hit `Multiple connections to a server or shared resource by the same user` error
log on to the Windows node, run `Get-SmbGlobalMapping` to list all mappings, run `Remove-SmbGlobalMapping -RemotePath xxx` to remove existing mapping, after a while, pod remount would succeed automatically
log on to the Windows node, run `Get-SmbGlobalMapping` to list all mappings, run `Remove-SmbGlobalMapping -RemotePath xxx` to remove existing mapping, after a while, pod remount would succeed automatically

View File

@ -550,7 +550,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
}

View File

@ -20,7 +20,7 @@ if [[ -z "$(command -v csc)" ]]; then
GO111MODULE=off go get github.com/rexray/gocsi/csc
fi
readonly dirname="/tmp/$(date +%s)"
dirname="/tmp/$(date +%s)"
mkdir "$dirname"
export PERMISSIONS=0777
@ -36,7 +36,7 @@ function cleanup {
}
readonly CSC_BIN="$GOBIN/csc"
readonly volname="citest-$(date +%s)"
volname="citest-$(date +%s)"
endpoint='tcp://127.0.0.1:10000'
staging_target_path='/tmp/stagingtargetpath'
target_path='/tmp/targetpath'
@ -56,10 +56,10 @@ sleep 5
params='source=//0.0.0.0/share'
# Begin to run CSI functions one by one
echo 'Create volume test:'
readonly value=$("$CSC_BIN" controller new --endpoint "$endpoint" --cap 1,block "$volname" --req-bytes 2147483648 --params "$params")
value=$("$CSC_BIN" controller new --endpoint "$endpoint" --cap 1,block "$volname" --req-bytes 2147483648 --params "$params")
sleep 2
readonly volumeid=$(echo "$value" | awk '{print $1}' | sed 's/"//g')
volumeid=$(echo "$value" | awk '{print $1}' | sed 's/"//g')
echo "Got volume id: $volumeid"
# set secret for csc node stage

View File

@ -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 ..."

View File

@ -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
KUBERNETES_VERSION=v1.18.8
KUBECONFIG=$HOME/.kube/config
@ -24,7 +24,7 @@ curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$KUBE
sudo kind create cluster --image kindest/node:$KUBERNETES_VERSION
mkdir -p $HOME/.kube
sudo chown -R $USER: $HOME/.kube/
sudo kind get kubeconfig > $KUBECONFIG
kind get kubeconfig > $KUBECONFIG
echo "Setup samba server and deploy SMB CSI driver"
kubectl cluster-info

View File

@ -1,3 +1,5 @@
#!/bin/bash
# Copyright 2020 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@ -12,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#!/bin/bash
export CHANGE_MINIKUBE_NONE_USER=true
export MINIKUBE_WANTUPDATENOTIFICATION=false
export MINIKUBE_WANTREPORTERRORPROMPT=false
@ -37,4 +38,4 @@ kubectl create -f deploy/example/smb-provisioner/smb-server.yaml
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n default get pods -lapp=smb-server -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1;echo "waiting for smb controller deployment to be available"; done
bash deploy/install-driver.sh
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n kube-system get pods -lapp=csi-smb-controller -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1;echo "waiting for smb controller deployment to be available"; done
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n kube-system get pods -lapp=csi-smb-node -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1;echo "waiting for smb node deployment to be available"; done
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n kube-system get pods -lapp=csi-smb-node -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1;echo "waiting for smb node deployment to be available"; done

View File

@ -1,3 +1,5 @@
#!/bin/bash
# Copyright 2021 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 -euo pipefail
echo "Deleting the Driver node daemonset ..."

View File

@ -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