Skip to content

Commit 044e271

Browse files
authored
Merge pull request #81 from gossion/guwe/spell
Enable spell checking and fix spelling issues
2 parents 3551e2d + 8f7659e commit 044e271

File tree

6 files changed

+62
-7
lines changed

6 files changed

+62
-7
lines changed

docs/driver-parameters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ volumeAttributes.containerName | existing container name | existing container na
2929
volumeAttributes.storageAccountName | existing storage account name | existing storage account name | Yes |
3030
volumeAttributes.keyVaultURL | Azure Key Vault DNS name | existing Azure Key Vault DNS name | No |
3131
volumeAttributes.keyVaultSecretName | Azure Key Vault secret name | existing Azure Key Vault secret name | No |
32-
volumeAttributes.keyVaultSecretVersion | Azure Key Vault secret version | existing version | No |if empty, driver will use "current versoin"
32+
volumeAttributes.keyVaultSecretVersion | Azure Key Vault secret version | existing version | No |if empty, driver will use "current version"
3333
nodePublishSecretRef.name | secret name that stores storage account name and key(or sastoken) | existing kubernetes secret name | No |
3434
nodePublishSecretRef.namespace | namespace where the secret is | k8s namespace | No | `default`

docs/read-from-keyvault.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Please refer to [install blobfuse csi driver](https://github.com/kubernetes-sigs
2525

2626
## Create PV
2727
1. Download a `pv-blobfuse-csi-keyvault.yaml`, edit `keyVaultURL`, `keyVaultSecretName`, `containerName` in PV
28-
> `keyVaultSecretVersion` is the optional parameter. If not specified, it will be *current versoin*.
28+
> `keyVaultSecretVersion` is the optional parameter. If not specified, it will be *current version*.
2929
```console
3030
wget https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/pv-blobfuse-csi-keyvault.yaml
3131
vi pv-blobfuse-csi-keyvault.yaml

hack/verify-all.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ ${PKG_ROOT}/hack/verify-govet.sh
2323
${PKG_ROOT}/hack/verify-golint.sh
2424
${PKG_ROOT}/hack/verify-dep.sh
2525
${PKG_ROOT}/hack/verify-boilerplate.sh
26+
${PKG_ROOT}/hack/verify-spelling.sh

hack/verify-spelling.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2019 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -o errexit
18+
set -o nounset
19+
set -o pipefail
20+
21+
TOOL_VERSION="v0.3.4"
22+
23+
# cd to the root path
24+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
25+
cd "${ROOT}"
26+
27+
# create a temporary directory
28+
TMP_DIR=$(mktemp -d)
29+
30+
# cleanup
31+
exitHandler() (
32+
echo "Cleaning up..."
33+
rm -rf "${TMP_DIR}"
34+
)
35+
trap exitHandler EXIT
36+
37+
# perform go get in a temp dir as we are not tracking this version in a go module
38+
# if we do the go get in the repo, it will create / update a go.mod and go.sum
39+
cd "${TMP_DIR}"
40+
GO111MODULE=on GOBIN="${TMP_DIR}" go get "github.com/client9/misspell/cmd/misspell@${TOOL_VERSION}"
41+
export PATH="${TMP_DIR}:${PATH}"
42+
cd "${ROOT}"
43+
44+
# check spelling
45+
RES=0
46+
echo "Checking spelling..."
47+
ERROR_LOG="${TMP_DIR}/errors.log"
48+
git ls-files | grep -v vendor | xargs misspell > "${ERROR_LOG}"
49+
if [[ -s "${ERROR_LOG}" ]]; then
50+
sed 's/^/error: /' "${ERROR_LOG}" # add 'error' to each line to highlight in e2e status
51+
echo "Found spelling errors!"
52+
RES=1
53+
fi
54+
exit "${RES}"

pkg/blobfuse/blobfuse.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import (
3535
const (
3636
// DriverName holds the name of the csi-driver
3737
DriverName = "blobfuse.csi.azure.com"
38-
seperator = "#"
38+
separator = "#"
3939
volumeIDTemplate = "%s#%s#%s"
4040
fileMode = "file_mode"
4141
dirMode = "dir_mode"
@@ -114,7 +114,7 @@ func (d *Driver) Run(endpoint string) {
114114
// input: "rg#f5713de20cde511e8ba4900#pvc-fuse-dynamic-17e43f84-f474-11e8-acd0-000d3a00df41"
115115
// output: rg, f5713de20cde511e8ba4900, pvc-fuse-dynamic-17e43f84-f474-11e8-acd0-000d3a00df41
116116
func getContainerInfo(id string) (string, string, string, error) {
117-
segments := strings.Split(id, seperator)
117+
segments := strings.Split(id, separator)
118118
if len(segments) < 3 {
119119
return "", "", "", fmt.Errorf("error parsing volume id: %q, should at least contain two #", id)
120120
}
@@ -172,11 +172,11 @@ func getStorageAccountFromSecretsMap(secrets map[string]string) (string, string,
172172
switch strings.ToLower(k) {
173173
case "accountname":
174174
accountName = v
175-
case "azurestorageaccountname": // for compatability with built-in blobfuse plugin
175+
case "azurestorageaccountname": // for compatibility with built-in blobfuse plugin
176176
accountName = v
177177
case "accountkey":
178178
accountKey = v
179-
case "azurestorageaccountkey": // for compatability with built-in blobfuse plugin
179+
case "azurestorageaccountkey": // for compatibility with built-in blobfuse plugin
180180
accountKey = v
181181
case "azurestorageaccountsastoken":
182182
accountSasToken = v

pkg/util/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func roundUpSize(volumeSizeBytes int64, allocationUnitBytes int64) int64 {
5555
return roundedUp
5656
}
5757

58-
// GetMountOptions return options with string list seperated by space
58+
// GetMountOptions return options with string list separated by space
5959
func GetMountOptions(options []string) string {
6060
if len(options) == 0 {
6161
return ""

0 commit comments

Comments
 (0)