Skip to content

Commit 386f981

Browse files
committed
fix(pkg): delete unused var or const
1 parent db1f8da commit 386f981

File tree

9 files changed

+6
-85
lines changed

9 files changed

+6
-85
lines changed

pkg/volume/azure_dd/azure_common_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ var (
6464
lunStr = "1"
6565
diskPath = "4:0:0:" + lunStr
6666
devName = "sdd"
67-
lun1 = 2
6867
lunStr1 = "2"
6968
diskPath1 = "3:0:0:" + lunStr1
7069
devName1 = "sde"

pkg/volume/csi/csi_plugin.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ const (
6060
CsiResyncPeriod = time.Minute
6161
)
6262

63-
var deprecatedSocketDirVersions = []string{"0.1.0", "0.2.0", "0.3.0", "0.4.0"}
64-
6563
type csiPlugin struct {
6664
host volume.VolumeHost
6765
blockEnabled bool

pkg/volume/flexvolume/driver-call.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ const (
5252
optionReadWrite = "kubernetes.io/readwrite"
5353
optionKeySecret = "kubernetes.io/secret"
5454
optionFSGroup = "kubernetes.io/mounterArgs.FsGroup"
55-
optionMountsDir = "kubernetes.io/mountsDir"
5655
optionPVorVolumeName = "kubernetes.io/pvOrVolumeName"
5756

5857
optionKeyPodName = "kubernetes.io/pod.name"

pkg/volume/flexvolume/flexvolume_test.go

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -74,59 +74,6 @@ exit 1
7474
echo -n $@ &> {{.OutputFile}}
7575
`
7676

77-
const execScriptTempl2 = `#!/usr/bin/env bash
78-
if [ "$1" == "init" -a $# -eq 1 ]; then
79-
echo -n '{
80-
"status": "Success"
81-
}'
82-
exit 0
83-
fi
84-
85-
if [ "$1" == "getvolumename" -a $# -eq 2 ]; then
86-
echo -n '{
87-
"status": "Success",
88-
"volumeName": "fakevolume"
89-
}'
90-
exit 0
91-
elif [ "$1" == "mount" -a $# -eq 4 ]; then
92-
PATH=$2
93-
/bin/mkdir -p $PATH
94-
if [ $? -ne 0 ]; then
95-
echo -n '{
96-
"status": "Failure",
97-
"reason": "Failed to create $PATH"
98-
}'
99-
exit 1
100-
fi
101-
echo -n '{
102-
"status": "Success"
103-
}'
104-
exit 0
105-
elif [ "$1" == "unmount" -a $# -eq 2 ]; then
106-
PATH=$2
107-
/bin/rm -r $PATH
108-
if [ $? -ne 0 ]; then
109-
echo -n '{
110-
"status": "Failure",
111-
"reason": "Failed to cleanup $PATH"
112-
}'
113-
exit 1
114-
fi
115-
echo -n '{
116-
"status": "Success"
117-
}'
118-
exit 0
119-
fi
120-
121-
echo -n '{
122-
"status": "Not Supported"
123-
}'
124-
exit 1
125-
126-
# Direct the arguments to a file to be tested against later
127-
echo -n $@ &> {{.OutputFile}}
128-
`
129-
13077
func installPluginUnderTest(t *testing.T, vendorName, plugName, tmpDir string, execScriptTempl string, execTemplateData *map[string]interface{}) {
13178
vendoredName := plugName
13279
if vendorName != "" {

pkg/volume/glusterfs/glusterfs.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,12 @@ const (
8888
// default values, but they play a different role and
8989
// could take a different value. Only thing we need is:
9090
// absGidMin <= defGidMin <= defGidMax <= absGidMax
91-
absoluteGidMin = 2000
92-
absoluteGidMax = math.MaxInt32
93-
linuxGlusterMountBinary = "mount.glusterfs"
94-
heketiAnn = "heketi-dynamic-provisioner"
95-
glusterTypeAnn = "gluster.org/type"
96-
glusterDescAnn = "Gluster-Internal: Dynamically provisioned PV"
97-
heketiVolIDAnn = "gluster.kubernetes.io/heketi-volume-id"
91+
absoluteGidMin = 2000
92+
absoluteGidMax = math.MaxInt32
93+
heketiAnn = "heketi-dynamic-provisioner"
94+
glusterTypeAnn = "gluster.org/type"
95+
glusterDescAnn = "Gluster-Internal: Dynamically provisioned PV"
96+
heketiVolIDAnn = "gluster.kubernetes.io/heketi-volume-id"
9897

9998
// Error string returned by heketi
10099
errIDNotFound = "Id not found"

pkg/volume/rbd/rbd.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ const (
7272
rbdDefaultAdminId = "admin"
7373
rbdDefaultAdminSecretNamespace = "default"
7474
rbdDefaultPool = "rbd"
75-
rbdDefaultUserId = rbdDefaultAdminId
7675
)
7776

7877
func getPath(uid types.UID, volName string, host volume.VolumeHost) string {

pkg/volume/rbd/rbd_util.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ import (
4747

4848
const (
4949
imageWatcherStr = "watcher="
50-
imageSizeStr = "size "
5150
kubeLockMagic = "kubelet_lock_magic_"
5251
// The following three values are used for 30 seconds timeout
5352
// while waiting for RBD Watcher to expire.

pkg/volume/storageos/storageos_util_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
"testing"
3131
)
3232

33-
var testAPISecretName = "storageos-api"
3433
var testVolName = "storageos-test-vol"
3534
var testPVName = "storageos-test-pv"
3635
var testNamespace = "storageos-test-namespace"

pkg/volume/util/fsquota/quota_linux_test.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,6 @@ tmpfs /tmp tmpfs rw,nosuid,nodev 0 0
4343
/dev/sdb1 /virt xfs rw,noatime,attr2,inode64,usrquota,prjquota 0 0
4444
`
4545

46-
const dummyMountDataPquota = `tmpfs /tmp tmpfs rw,nosuid,nodev 0 0
47-
/dev/sda1 /boot ext4 rw,relatime 0 0
48-
/dev/mapper/fedora-root / ext4 rw,noatime 0 0
49-
/dev/mapper/fedora-home /home ext4 rw,noatime 0 0
50-
/dev/sdb1 /mnt/virt xfs rw,noatime,attr2,inode64,usrquota,prjquota 0 0
51-
`
52-
const dummyMountDataNoPquota = `tmpfs /tmp tmpfs rw,nosuid,nodev 0 0
53-
/dev/sda1 /boot ext4 rw,relatime 0 0
54-
/dev/mapper/fedora-root / ext4 rw,noatime 0 0
55-
/dev/mapper/fedora-home /home ext4 rw,noatime 0 0
56-
/dev/sdb1 /mnt/virt xfs rw,noatime,attr2,inode64,usrquota 0 0
57-
`
58-
59-
const dummyMountTest = `/dev/sda1 / ext4 rw,noatime 0 0
60-
/dev/sda2 /quota ext4 rw,prjquota 0 0
61-
/dev/sda3 /noquota ext4 rw 0 0
62-
`
63-
6446
func dummyFakeMount1() mount.Interface {
6547
return &mount.FakeMounter{
6648
MountPoints: []mount.MountPoint{

0 commit comments

Comments
 (0)