Skip to content

Commit 93c2eed

Browse files
authored
Merge pull request kubernetes#84901 from SataQiu/golint-e2e-node-20191107
Fix golint issues in test/e2e_node
2 parents 98abd32 + d2bdf89 commit 93c2eed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+104
-101
lines changed

hack/.golint_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,6 @@ staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/flunder
536536
test/e2e/common
537537
test/e2e/lifecycle/bootstrap
538538
test/e2e/storage/vsphere
539-
test/e2e_node
540539
test/e2e_node/remote
541540
test/e2e_node/runner/remote
542541
test/utils

test/e2e_node/apparmor_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package e2e_node
17+
package e2enode
1818

1919
import (
2020
"bytes"

test/e2e_node/benchmark_util.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
1616
limitations under the License.
1717
*/
1818

19-
package e2e_node
19+
package e2enode
2020

2121
import (
2222
"fmt"
@@ -36,7 +36,9 @@ import (
3636
)
3737

3838
const (
39+
// TimeSeriesTag is the tag for time series.
3940
TimeSeriesTag = "[Result:TimeSeries]"
41+
// TimeSeriesEnd is the end tag for time series.
4042
TimeSeriesEnd = "[Finish:TimeSeries]"
4143
)
4244

test/e2e_node/container_log_rotation_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package e2e_node
17+
package e2enode
1818

1919
import (
2020
"time"

test/e2e_node/container_manager_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
1616
limitations under the License.
1717
*/
1818

19-
package e2e_node
19+
package e2enode
2020

2121
import (
2222
"fmt"

test/e2e_node/cpu_manager_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package e2e_node
17+
package e2enode
1818

1919
import (
2020
"fmt"

test/e2e_node/critical_pod_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package e2e_node
17+
package e2enode
1818

1919
import (
2020
"fmt"

test/e2e_node/density_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
1616
limitations under the License.
1717
*/
1818

19-
package e2e_node
19+
package e2enode
2020

2121
import (
2222
"fmt"

test/e2e_node/device_plugin_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package e2e_node
17+
package e2enode
1818

1919
import (
2020
"path/filepath"
@@ -96,8 +96,8 @@ func testDevicePlugin(f *framework.Framework, pluginSockDir string) {
9696
podRECMD := "devs=$(ls /tmp/ | egrep '^Dev-[0-9]+$') && echo stub devices: $devs"
9797
pod1 := f.PodClient().CreateSync(makeBusyboxPod(resourceName, podRECMD))
9898
deviceIDRE := "stub devices: (Dev-[0-9]+)"
99-
devId1 := parseLog(f, pod1.Name, pod1.Name, deviceIDRE)
100-
gomega.Expect(devId1).To(gomega.Not(gomega.Equal("")))
99+
devID1 := parseLog(f, pod1.Name, pod1.Name, deviceIDRE)
100+
gomega.Expect(devID1).To(gomega.Not(gomega.Equal("")))
101101

102102
podResources, err := getNodeDevices()
103103
var resourcesForOurPod *kubeletpodresourcesv1alpha1.PodResources
@@ -125,8 +125,8 @@ func testDevicePlugin(f *framework.Framework, pluginSockDir string) {
125125
ensurePodContainerRestart(f, pod1.Name, pod1.Name)
126126

127127
ginkgo.By("Confirming that device assignment persists even after container restart")
128-
devIdAfterRestart := parseLog(f, pod1.Name, pod1.Name, deviceIDRE)
129-
framework.ExpectEqual(devIdAfterRestart, devId1)
128+
devIDAfterRestart := parseLog(f, pod1.Name, pod1.Name, deviceIDRE)
129+
framework.ExpectEqual(devIDAfterRestart, devID1)
130130

131131
restartTime := time.Now()
132132
ginkgo.By("Restarting Kubelet")
@@ -164,8 +164,8 @@ func testDevicePlugin(f *framework.Framework, pluginSockDir string) {
164164

165165
ensurePodContainerRestart(f, pod1.Name, pod1.Name)
166166
ginkgo.By("Confirming that after a kubelet restart, fake-device assignement is kept")
167-
devIdRestart1 := parseLog(f, pod1.Name, pod1.Name, deviceIDRE)
168-
framework.ExpectEqual(devIdRestart1, devId1)
167+
devIDRestart1 := parseLog(f, pod1.Name, pod1.Name, deviceIDRE)
168+
framework.ExpectEqual(devIDRestart1, devID1)
169169

170170
ginkgo.By("Waiting for resource to become available on the local node after re-registration")
171171
gomega.Eventually(func() bool {
@@ -179,9 +179,9 @@ func testDevicePlugin(f *framework.Framework, pluginSockDir string) {
179179
pod2 := f.PodClient().CreateSync(makeBusyboxPod(resourceName, podRECMD))
180180

181181
ginkgo.By("Checking that pod got a different fake device")
182-
devId2 := parseLog(f, pod2.Name, pod2.Name, deviceIDRE)
182+
devID2 := parseLog(f, pod2.Name, pod2.Name, deviceIDRE)
183183

184-
gomega.Expect(devId1).To(gomega.Not(gomega.Equal(devId2)))
184+
gomega.Expect(devID1).To(gomega.Not(gomega.Equal(devID2)))
185185

186186
ginkgo.By("By deleting the pods and waiting for container removal")
187187
err = f.ClientSet.CoreV1().Pods(metav1.NamespaceSystem).Delete(dp.Name, &deleteOptions)
@@ -197,12 +197,12 @@ func testDevicePlugin(f *framework.Framework, pluginSockDir string) {
197197

198198
ginkgo.By("Checking that scheduled pods can continue to run even after we delete device plugin.")
199199
ensurePodContainerRestart(f, pod1.Name, pod1.Name)
200-
devIdRestart1 = parseLog(f, pod1.Name, pod1.Name, deviceIDRE)
201-
framework.ExpectEqual(devIdRestart1, devId1)
200+
devIDRestart1 = parseLog(f, pod1.Name, pod1.Name, deviceIDRE)
201+
framework.ExpectEqual(devIDRestart1, devID1)
202202

203203
ensurePodContainerRestart(f, pod2.Name, pod2.Name)
204-
devIdRestart2 := parseLog(f, pod2.Name, pod2.Name, deviceIDRE)
205-
framework.ExpectEqual(devIdRestart2, devId2)
204+
devIDRestart2 := parseLog(f, pod2.Name, pod2.Name, deviceIDRE)
205+
framework.ExpectEqual(devIDRestart2, devID2)
206206

207207
ginkgo.By("Re-register resources")
208208
devicePluginPod, err = f.ClientSet.CoreV1().Pods(metav1.NamespaceSystem).Create(dp)

test/e2e_node/doc.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
// e2e_node contains e2e tests specific to the node
18-
// TODO: rename this package e2e-node
19-
package e2e_node // import "k8s.io/kubernetes/test/e2e_node"
17+
// Package e2enode contains e2e tests specific to the node
18+
package e2enode // import "k8s.io/kubernetes/test/e2e_node"

0 commit comments

Comments
 (0)