Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix golint failures of test/e2e/storage/testsuites #79088

Merged
merged 1 commit into from
Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion hack/.golint_failures
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,6 @@ staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/flunder
test/e2e/common
test/e2e/lifecycle/bootstrap
test/e2e/scalability
test/e2e/storage/testsuites
test/e2e/storage/vsphere
test/e2e_kubeadm
test/e2e_node
Expand Down
9 changes: 4 additions & 5 deletions test/e2e/storage/testsuites/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,15 +574,14 @@ func getMigrationVolumeOpCounts(cs clientset.Interface, pluginName string) (opCo
migratedOps = getVolumeOpCounts(cs, csiName)
}
return getVolumeOpCounts(cs, pluginName), migratedOps
} else {
// Not an in-tree driver
e2elog.Logf("Test running for native CSI Driver, not checking metrics")
return opCounts{}, opCounts{}
}
// Not an in-tree driver
e2elog.Logf("Test running for native CSI Driver, not checking metrics")
return opCounts{}, opCounts{}
}

func getTotOps(ops opCounts) int64 {
var tot int64 = 0
var tot = int64(0)
for _, count := range ops {
tot += count
}
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/storage/testsuites/provisioning.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ func PVMultiNodeCheck(client clientset.Interface, claim *v1.PersistentVolumeClai
pod = nil
}

// TestBindingWaitForFirstConsumer tests the binding with WaitForFirstConsumer mode
func (t StorageClassTest) TestBindingWaitForFirstConsumer(nodeSelector map[string]string, expectUnschedulable bool) (*v1.PersistentVolume, *v1.Node) {
pvs, node := t.TestBindingWaitForFirstConsumerMultiPVC([]*v1.PersistentVolumeClaim{t.Claim}, nodeSelector, expectUnschedulable)
if pvs == nil {
Expand All @@ -447,6 +448,7 @@ func (t StorageClassTest) TestBindingWaitForFirstConsumer(nodeSelector map[strin
return pvs[0], node
}

// TestBindingWaitForFirstConsumerMultiPVC tests the binding with WaitForFirstConsumer mode
func (t StorageClassTest) TestBindingWaitForFirstConsumerMultiPVC(claims []*v1.PersistentVolumeClaim, nodeSelector map[string]string, expectUnschedulable bool) ([]*v1.PersistentVolume, *v1.Node) {
var err error
gomega.Expect(len(claims)).ToNot(gomega.Equal(0))
Expand Down
9 changes: 0 additions & 9 deletions test/e2e/storage/testsuites/snapshottable.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@ var (
snapshotContentGVR = schema.GroupVersionResource{Group: snapshotGroup, Version: "v1alpha1", Resource: "volumesnapshotcontents"}
)

type SnapshotClassTest struct {
Name string
CloudProviders []string
Snapshotter string
Parameters map[string]string
NodeName string
NodeSelector map[string]string // NodeSelector for the pod
}

type snapshottableTestSuite struct {
tsInfo TestSuiteInfo
}
Expand Down
1 change: 1 addition & 0 deletions test/e2e/storage/testsuites/testdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ type SnapshottableTestDriver interface {
// Capability represents a feature that a volume plugin supports
type Capability string

// Constants related to capability
const (
CapPersistence Capability = "persistence" // data is persisted across pod restarts
CapBlock Capability = "block" // raw block mode
Expand Down