Skip to content

Commit 0b184d3

Browse files
committed
fixgo lint failures test/integration/...
update pull request update pull request add files update pull request
1 parent 4938cc3 commit 0b184d3

File tree

6 files changed

+27
-32
lines changed

6 files changed

+27
-32
lines changed

hack/.golint_failures

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,4 @@ test/integration/master
706706
test/integration/replicaset
707707
test/integration/replicationcontroller
708708
test/integration/scheduler
709-
test/integration/scheduler_perf
710-
test/integration/volume
711709
test/utils

test/integration/scheduler_perf/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ go_library(
1414
],
1515
importpath = "k8s.io/kubernetes/test/integration/scheduler_perf",
1616
deps = [
17-
"//pkg/scheduler/algorithmprovider:go_default_library",
1817
"//pkg/scheduler/factory:go_default_library",
1918
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
2019
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",

test/integration/scheduler_perf/scheduler_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func schedulePods(config *testConfig) int32 {
130130
prev := 0
131131
// On startup there may be a latent period where NO scheduling occurs (qps = 0).
132132
// We are interested in low scheduling rates (i.e. qps=2),
133-
minQps := int32(math.MaxInt32)
133+
minQPS := int32(math.MaxInt32)
134134
start := time.Now()
135135
// Bake in time for the first pod scheduling event.
136136
for {
@@ -167,15 +167,15 @@ func schedulePods(config *testConfig) int32 {
167167
consumed = 1
168168
}
169169
fmt.Printf("Scheduled %v Pods in %v seconds (%v per second on average). min QPS was %v\n",
170-
config.numPods, consumed, config.numPods/consumed, minQps)
171-
return minQps
170+
config.numPods, consumed, config.numPods/consumed, minQPS)
171+
return minQPS
172172
}
173173

174174
// There's no point in printing it for the last iteration, as the value is random
175175
qps := len(scheduled) - prev
176-
qpsStats[qps] += 1
177-
if int32(qps) < minQps {
178-
minQps = int32(qps)
176+
qpsStats[qps]++
177+
if int32(qps) < minQPS {
178+
minQPS = int32(qps)
179179
}
180180
fmt.Printf("%ds\trate: %d\ttotal: %d (qps frequency: %v)\n", time.Since(start)/time.Second, qps, len(scheduled), qpsStats)
181181
prev = len(scheduled)

test/integration/scheduler_perf/util.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"k8s.io/apimachinery/pkg/runtime/schema"
2121
clientset "k8s.io/client-go/kubernetes"
2222
restclient "k8s.io/client-go/rest"
23-
_ "k8s.io/kubernetes/pkg/scheduler/algorithmprovider"
2423
"k8s.io/kubernetes/pkg/scheduler/factory"
2524
"k8s.io/kubernetes/test/integration/util"
2625
)

test/integration/volume/attach_detach_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,8 @@ func waitToObservePods(t *testing.T, podInformer cache.SharedIndexInformer, podN
350350
objects := podInformer.GetIndexer().List()
351351
if len(objects) == podNum {
352352
return true, nil
353-
} else {
354-
return false, nil
355353
}
354+
return false, nil
356355
}); err != nil {
357356
t.Fatal(err)
358357
}

test/integration/volume/persistent_volumes_test.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func TestPersistentVolumeBindRace(t *testing.T) {
244244
maxClaims := 100
245245
claims := []*v1.PersistentVolumeClaim{}
246246
for counter <= maxClaims {
247-
counter += 1
247+
counter++
248248
newPvc := pvc.DeepCopy()
249249
newPvc.ObjectMeta = metav1.ObjectMeta{Name: fmt.Sprintf("fake-pvc-race-%d", counter)}
250250
claim, err := testClient.CoreV1().PersistentVolumeClaims(ns.Name).Create(newPvc)
@@ -313,19 +313,19 @@ func TestPersistentVolumeClaimLabelSelector(t *testing.T) {
313313
modes = []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}
314314
reclaim = v1.PersistentVolumeReclaimRetain
315315

316-
pv_true = createPV("pv-true", "/tmp/foo-label", "1G", modes, reclaim)
317-
pv_false = createPV("pv-false", "/tmp/foo-label", "1G", modes, reclaim)
318-
pvc = createPVC("pvc-ls-1", ns.Name, "1G", modes, "")
316+
pvTrue = createPV("pv-true", "/tmp/foo-label", "1G", modes, reclaim)
317+
pvFalse = createPV("pv-false", "/tmp/foo-label", "1G", modes, reclaim)
318+
pvc = createPVC("pvc-ls-1", ns.Name, "1G", modes, "")
319319
)
320320

321-
pv_true.ObjectMeta.SetLabels(map[string]string{"foo": "true"})
322-
pv_false.ObjectMeta.SetLabels(map[string]string{"foo": "false"})
321+
pvTrue.ObjectMeta.SetLabels(map[string]string{"foo": "true"})
322+
pvFalse.ObjectMeta.SetLabels(map[string]string{"foo": "false"})
323323

324-
_, err = testClient.CoreV1().PersistentVolumes().Create(pv_true)
324+
_, err = testClient.CoreV1().PersistentVolumes().Create(pvTrue)
325325
if err != nil {
326326
t.Fatalf("Failed to create PersistentVolume: %v", err)
327327
}
328-
_, err = testClient.CoreV1().PersistentVolumes().Create(pv_false)
328+
_, err = testClient.CoreV1().PersistentVolumes().Create(pvFalse)
329329
if err != nil {
330330
t.Fatalf("Failed to create PersistentVolume: %v", err)
331331
}
@@ -394,19 +394,19 @@ func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) {
394394
modes = []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}
395395
reclaim = v1.PersistentVolumeReclaimRetain
396396

397-
pv_true = createPV("pv-true", "/tmp/foo-label", "1G", modes, reclaim)
398-
pv_false = createPV("pv-false", "/tmp/foo-label", "1G", modes, reclaim)
399-
pvc = createPVC("pvc-ls-1", ns.Name, "1G", modes, "")
397+
pvTrue = createPV("pv-true", "/tmp/foo-label", "1G", modes, reclaim)
398+
pvFalse = createPV("pv-false", "/tmp/foo-label", "1G", modes, reclaim)
399+
pvc = createPVC("pvc-ls-1", ns.Name, "1G", modes, "")
400400
)
401401

402-
pv_true.ObjectMeta.SetLabels(map[string]string{"foo": "valA", "bar": ""})
403-
pv_false.ObjectMeta.SetLabels(map[string]string{"foo": "valB", "baz": ""})
402+
pvTrue.ObjectMeta.SetLabels(map[string]string{"foo": "valA", "bar": ""})
403+
pvFalse.ObjectMeta.SetLabels(map[string]string{"foo": "valB", "baz": ""})
404404

405-
_, err = testClient.CoreV1().PersistentVolumes().Create(pv_true)
405+
_, err = testClient.CoreV1().PersistentVolumes().Create(pvTrue)
406406
if err != nil {
407407
t.Fatalf("Failed to create PersistentVolume: %v", err)
408408
}
409-
_, err = testClient.CoreV1().PersistentVolumes().Create(pv_false)
409+
_, err = testClient.CoreV1().PersistentVolumes().Create(pvFalse)
410410
if err != nil {
411411
t.Fatalf("Failed to create PersistentVolume: %v", err)
412412
}
@@ -539,7 +539,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) {
539539
t.Fatalf("Bind mismatch! Expected %s capacity %d but got %s capacity %d", pvc.Name, expectedCapVal, pv.Spec.ClaimRef.Name, pvCap)
540540
}
541541
t.Logf("claim bounded to %s capacity %v", pv.Name, pv.Spec.Capacity[v1.ResourceStorage])
542-
bound += 1
542+
bound++
543543
}
544544
t.Log("volumes checked")
545545

@@ -965,18 +965,18 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
965965
defer close(stopCh)
966966

967967
// This PV will be claimed, released, and deleted
968-
pv_rwo := createPV("pv-rwo", "/tmp/foo", "10G",
968+
pvRwo := createPV("pv-rwo", "/tmp/foo", "10G",
969969
[]v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, v1.PersistentVolumeReclaimRetain)
970-
pv_rwm := createPV("pv-rwm", "/tmp/bar", "10G",
970+
pvRwm := createPV("pv-rwm", "/tmp/bar", "10G",
971971
[]v1.PersistentVolumeAccessMode{v1.ReadWriteMany}, v1.PersistentVolumeReclaimRetain)
972972

973973
pvc := createPVC("pvc-rwm", ns.Name, "5G", []v1.PersistentVolumeAccessMode{v1.ReadWriteMany}, "")
974974

975-
_, err := testClient.CoreV1().PersistentVolumes().Create(pv_rwm)
975+
_, err := testClient.CoreV1().PersistentVolumes().Create(pvRwm)
976976
if err != nil {
977977
t.Errorf("Failed to create PersistentVolume: %v", err)
978978
}
979-
_, err = testClient.CoreV1().PersistentVolumes().Create(pv_rwo)
979+
_, err = testClient.CoreV1().PersistentVolumes().Create(pvRwo)
980980
if err != nil {
981981
t.Errorf("Failed to create PersistentVolume: %v", err)
982982
}

0 commit comments

Comments
 (0)