make use of short declaration of variables and cleanup code

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Chirammal
2022-04-12 22:48:26 +05:30
parent d45bacb34b
commit f30b14f8fd
16 changed files with 66 additions and 61 deletions

View File

@@ -17,26 +17,27 @@ limitations under the License.
package sidecar_controller
import (
"errors"
"fmt"
"testing"
"time"
"errors"
crdv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1"
"github.com/kubernetes-csi/external-snapshotter/v6/pkg/utils"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
var defaultSize int64 = 1000
var emptySize int64
var deletePolicy = crdv1.VolumeSnapshotContentDelete
var retainPolicy = crdv1.VolumeSnapshotContentRetain
var timeNow = time.Now()
var timeNowMetav1 = metav1.Now()
var False = false
var True = true
var (
defaultSize int64 = 1000
emptySize int64
deletePolicy = crdv1.VolumeSnapshotContentDelete
retainPolicy = crdv1.VolumeSnapshotContentRetain
timeNow = time.Now()
timeNowMetav1 = metav1.Now()
False = false
True = true
)
var class1Parameters = map[string]string{
"param1": "value1",
@@ -149,7 +150,6 @@ var snapshotClasses = []*crdv1.VolumeSnapshotClass{
// 2. Call the syncContent *once*.
// 3. Compare resulting contents with expected contents.
func TestDeleteSync(t *testing.T) {
tests := []controllerTest{
{
name: "1-1 - content non-nil DeletionTimestamp with delete policy will delete snapshot",