mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #82909 from hwdef/del-unused-var1
fix(pkg): delete unused var or const
This commit is contained in:
commit
2e4d02e9ab
@ -64,7 +64,6 @@ var (
|
||||
lunStr = "1"
|
||||
diskPath = "4:0:0:" + lunStr
|
||||
devName = "sdd"
|
||||
lun1 = 2
|
||||
lunStr1 = "2"
|
||||
diskPath1 = "3:0:0:" + lunStr1
|
||||
devName1 = "sde"
|
||||
|
@ -60,8 +60,6 @@ const (
|
||||
CsiResyncPeriod = time.Minute
|
||||
)
|
||||
|
||||
var deprecatedSocketDirVersions = []string{"0.1.0", "0.2.0", "0.3.0", "0.4.0"}
|
||||
|
||||
type csiPlugin struct {
|
||||
host volume.VolumeHost
|
||||
blockEnabled bool
|
||||
|
@ -52,7 +52,6 @@ const (
|
||||
optionReadWrite = "kubernetes.io/readwrite"
|
||||
optionKeySecret = "kubernetes.io/secret"
|
||||
optionFSGroup = "kubernetes.io/mounterArgs.FsGroup"
|
||||
optionMountsDir = "kubernetes.io/mountsDir"
|
||||
optionPVorVolumeName = "kubernetes.io/pvOrVolumeName"
|
||||
|
||||
optionKeyPodName = "kubernetes.io/pod.name"
|
||||
|
@ -74,59 +74,6 @@ exit 1
|
||||
echo -n $@ &> {{.OutputFile}}
|
||||
`
|
||||
|
||||
const execScriptTempl2 = `#!/usr/bin/env bash
|
||||
if [ "$1" == "init" -a $# -eq 1 ]; then
|
||||
echo -n '{
|
||||
"status": "Success"
|
||||
}'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" == "getvolumename" -a $# -eq 2 ]; then
|
||||
echo -n '{
|
||||
"status": "Success",
|
||||
"volumeName": "fakevolume"
|
||||
}'
|
||||
exit 0
|
||||
elif [ "$1" == "mount" -a $# -eq 4 ]; then
|
||||
PATH=$2
|
||||
/bin/mkdir -p $PATH
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -n '{
|
||||
"status": "Failure",
|
||||
"reason": "Failed to create $PATH"
|
||||
}'
|
||||
exit 1
|
||||
fi
|
||||
echo -n '{
|
||||
"status": "Success"
|
||||
}'
|
||||
exit 0
|
||||
elif [ "$1" == "unmount" -a $# -eq 2 ]; then
|
||||
PATH=$2
|
||||
/bin/rm -r $PATH
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -n '{
|
||||
"status": "Failure",
|
||||
"reason": "Failed to cleanup $PATH"
|
||||
}'
|
||||
exit 1
|
||||
fi
|
||||
echo -n '{
|
||||
"status": "Success"
|
||||
}'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo -n '{
|
||||
"status": "Not Supported"
|
||||
}'
|
||||
exit 1
|
||||
|
||||
# Direct the arguments to a file to be tested against later
|
||||
echo -n $@ &> {{.OutputFile}}
|
||||
`
|
||||
|
||||
func installPluginUnderTest(t *testing.T, vendorName, plugName, tmpDir string, execScriptTempl string, execTemplateData *map[string]interface{}) {
|
||||
vendoredName := plugName
|
||||
if vendorName != "" {
|
||||
|
@ -88,13 +88,12 @@ const (
|
||||
// default values, but they play a different role and
|
||||
// could take a different value. Only thing we need is:
|
||||
// absGidMin <= defGidMin <= defGidMax <= absGidMax
|
||||
absoluteGidMin = 2000
|
||||
absoluteGidMax = math.MaxInt32
|
||||
linuxGlusterMountBinary = "mount.glusterfs"
|
||||
heketiAnn = "heketi-dynamic-provisioner"
|
||||
glusterTypeAnn = "gluster.org/type"
|
||||
glusterDescAnn = "Gluster-Internal: Dynamically provisioned PV"
|
||||
heketiVolIDAnn = "gluster.kubernetes.io/heketi-volume-id"
|
||||
absoluteGidMin = 2000
|
||||
absoluteGidMax = math.MaxInt32
|
||||
heketiAnn = "heketi-dynamic-provisioner"
|
||||
glusterTypeAnn = "gluster.org/type"
|
||||
glusterDescAnn = "Gluster-Internal: Dynamically provisioned PV"
|
||||
heketiVolIDAnn = "gluster.kubernetes.io/heketi-volume-id"
|
||||
|
||||
// Error string returned by heketi
|
||||
errIDNotFound = "Id not found"
|
||||
|
@ -72,7 +72,6 @@ const (
|
||||
rbdDefaultAdminId = "admin"
|
||||
rbdDefaultAdminSecretNamespace = "default"
|
||||
rbdDefaultPool = "rbd"
|
||||
rbdDefaultUserId = rbdDefaultAdminId
|
||||
)
|
||||
|
||||
func getPath(uid types.UID, volName string, host volume.VolumeHost) string {
|
||||
|
@ -47,7 +47,6 @@ import (
|
||||
|
||||
const (
|
||||
imageWatcherStr = "watcher="
|
||||
imageSizeStr = "size "
|
||||
kubeLockMagic = "kubelet_lock_magic_"
|
||||
// The following three values are used for 30 seconds timeout
|
||||
// while waiting for RBD Watcher to expire.
|
||||
|
@ -30,7 +30,6 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
var testAPISecretName = "storageos-api"
|
||||
var testVolName = "storageos-test-vol"
|
||||
var testPVName = "storageos-test-pv"
|
||||
var testNamespace = "storageos-test-namespace"
|
||||
|
@ -43,24 +43,6 @@ tmpfs /tmp tmpfs rw,nosuid,nodev 0 0
|
||||
/dev/sdb1 /virt xfs rw,noatime,attr2,inode64,usrquota,prjquota 0 0
|
||||
`
|
||||
|
||||
const dummyMountDataPquota = `tmpfs /tmp tmpfs rw,nosuid,nodev 0 0
|
||||
/dev/sda1 /boot ext4 rw,relatime 0 0
|
||||
/dev/mapper/fedora-root / ext4 rw,noatime 0 0
|
||||
/dev/mapper/fedora-home /home ext4 rw,noatime 0 0
|
||||
/dev/sdb1 /mnt/virt xfs rw,noatime,attr2,inode64,usrquota,prjquota 0 0
|
||||
`
|
||||
const dummyMountDataNoPquota = `tmpfs /tmp tmpfs rw,nosuid,nodev 0 0
|
||||
/dev/sda1 /boot ext4 rw,relatime 0 0
|
||||
/dev/mapper/fedora-root / ext4 rw,noatime 0 0
|
||||
/dev/mapper/fedora-home /home ext4 rw,noatime 0 0
|
||||
/dev/sdb1 /mnt/virt xfs rw,noatime,attr2,inode64,usrquota 0 0
|
||||
`
|
||||
|
||||
const dummyMountTest = `/dev/sda1 / ext4 rw,noatime 0 0
|
||||
/dev/sda2 /quota ext4 rw,prjquota 0 0
|
||||
/dev/sda3 /noquota ext4 rw 0 0
|
||||
`
|
||||
|
||||
func dummyFakeMount1() mount.Interface {
|
||||
return &mount.FakeMounter{
|
||||
MountPoints: []mount.MountPoint{
|
||||
|
Loading…
Reference in New Issue
Block a user