@@ -30,14 +30,14 @@ import (
30
30
clientset "k8s.io/client-go/kubernetes"
31
31
"k8s.io/kubernetes/test/e2e/framework"
32
32
33
- . "github.com/onsi/ginkgo"
34
- . "github.com/onsi/gomega"
33
+ "github.com/onsi/ginkgo"
34
+ "github.com/onsi/gomega"
35
35
imageutils "k8s.io/kubernetes/test/utils/image"
36
36
)
37
37
38
38
// TODO: it would probably be slightly better to build up the objects
39
39
// in the code and then serialize to yaml.
40
- var reconcile_addon_controller = `
40
+ var reconcileAddonController = `
41
41
apiVersion: v1
42
42
kind: ReplicationController
43
43
metadata:
65
65
`
66
66
67
67
// Should update "reconcile" class addon.
68
- var reconcile_addon_controller_updated = `
68
+ var reconcileAddonControllerUpdated = `
69
69
apiVersion: v1
70
70
kind: ReplicationController
71
71
metadata:
93
93
protocol: TCP
94
94
`
95
95
96
- var ensure_exists_addon_service = `
96
+ var ensureExistsAddonService = `
97
97
apiVersion: v1
98
98
kind: Service
99
99
metadata:
@@ -112,7 +112,7 @@ spec:
112
112
`
113
113
114
114
// Should create but don't update "ensure exist" class addon.
115
- var ensure_exists_addon_service_updated = `
115
+ var ensureExistsAddonServiceUpdated = `
116
116
apiVersion: v1
117
117
kind: Service
118
118
metadata:
@@ -131,7 +131,7 @@ spec:
131
131
k8s-app: addon-ensure-exists-test
132
132
`
133
133
134
- var deprecated_label_addon_service = `
134
+ var deprecatedLabelAddonService = `
135
135
apiVersion: v1
136
136
kind: Service
137
137
metadata:
@@ -150,7 +150,7 @@ spec:
150
150
`
151
151
152
152
// Should update addon with label "kubernetes.io/cluster-service=true".
153
- var deprecated_label_addon_service_updated = `
153
+ var deprecatedLabelAddonServiceUpdated = `
154
154
apiVersion: v1
155
155
kind: Service
156
156
metadata:
@@ -170,7 +170,7 @@ spec:
170
170
`
171
171
172
172
// Should not create addon without valid label.
173
- var invalid_addon_controller = `
173
+ var invalidAddonController = `
174
174
apiVersion: v1
175
175
kind: ReplicationController
176
176
metadata:
@@ -214,7 +214,7 @@ var _ = SIGDescribe("Addon update", func() {
214
214
var sshClient * ssh.Client
215
215
f := framework .NewDefaultFramework ("addon-update-test" )
216
216
217
- BeforeEach (func () {
217
+ ginkgo . BeforeEach (func () {
218
218
// This test requires:
219
219
// - SSH master access
220
220
// ... so the provider check should be identical to the intersection of
@@ -225,17 +225,17 @@ var _ = SIGDescribe("Addon update", func() {
225
225
226
226
var err error
227
227
sshClient , err = getMasterSSHClient ()
228
- Expect (err ).NotTo (HaveOccurred (), "Failed to get the master SSH client." )
228
+ gomega . Expect (err ).NotTo (gomega . HaveOccurred (), "Failed to get the master SSH client." )
229
229
})
230
230
231
- AfterEach (func () {
231
+ ginkgo . AfterEach (func () {
232
232
if sshClient != nil {
233
233
sshClient .Close ()
234
234
}
235
235
})
236
236
237
237
// WARNING: the test is not parallel-friendly!
238
- It ("should propagate add-on file changes [Slow]" , func () {
238
+ ginkgo . It ("should propagate add-on file changes [Slow]" , func () {
239
239
// This test requires:
240
240
// - SSH
241
241
// - master access
@@ -244,7 +244,7 @@ var _ = SIGDescribe("Addon update", func() {
244
244
framework .SkipUnlessProviderIs ("gce" )
245
245
246
246
//these tests are long, so I squeezed several cases in one scenario
247
- Expect (sshClient ).NotTo (BeNil ())
247
+ gomega . Expect (sshClient ).NotTo (gomega . BeNil ())
248
248
dir = f .Namespace .Name // we use it only to give a unique string for each test execution
249
249
250
250
temporaryRemotePathPrefix := "addon-test-dir"
@@ -262,18 +262,18 @@ var _ = SIGDescribe("Addon update", func() {
262
262
svcAddonEnsureExistsUpdated := "addon-ensure-exists-service-updated.yaml"
263
263
264
264
var remoteFiles []stringPair = []stringPair {
265
- {fmt .Sprintf (reconcile_addon_controller , addonNsName , serveHostnameImage ), rcAddonReconcile },
266
- {fmt .Sprintf (reconcile_addon_controller_updated , addonNsName , serveHostnameImage ), rcAddonReconcileUpdated },
267
- {fmt .Sprintf (deprecated_label_addon_service , addonNsName ), svcAddonDeprecatedLabel },
268
- {fmt .Sprintf (deprecated_label_addon_service_updated , addonNsName ), svcAddonDeprecatedLabelUpdated },
269
- {fmt .Sprintf (ensure_exists_addon_service , addonNsName ), svcAddonEnsureExists },
270
- {fmt .Sprintf (ensure_exists_addon_service_updated , addonNsName ), svcAddonEnsureExistsUpdated },
271
- {fmt .Sprintf (invalid_addon_controller , addonNsName , serveHostnameImage ), rcInvalid },
265
+ {fmt .Sprintf (reconcileAddonController , addonNsName , serveHostnameImage ), rcAddonReconcile },
266
+ {fmt .Sprintf (reconcileAddonControllerUpdated , addonNsName , serveHostnameImage ), rcAddonReconcileUpdated },
267
+ {fmt .Sprintf (deprecatedLabelAddonService , addonNsName ), svcAddonDeprecatedLabel },
268
+ {fmt .Sprintf (deprecatedLabelAddonServiceUpdated , addonNsName ), svcAddonDeprecatedLabelUpdated },
269
+ {fmt .Sprintf (ensureExistsAddonService , addonNsName ), svcAddonEnsureExists },
270
+ {fmt .Sprintf (ensureExistsAddonServiceUpdated , addonNsName ), svcAddonEnsureExistsUpdated },
271
+ {fmt .Sprintf (invalidAddonController , addonNsName , serveHostnameImage ), rcInvalid },
272
272
}
273
273
274
274
for _ , p := range remoteFiles {
275
275
err := writeRemoteFile (sshClient , p .data , temporaryRemotePath , p .fileName , 0644 )
276
- Expect (err ).NotTo (HaveOccurred (), "Failed to write file %q at remote path %q with ssh client %+v" , p .fileName , temporaryRemotePath , sshClient )
276
+ gomega . Expect (err ).NotTo (gomega . HaveOccurred (), "Failed to write file %q at remote path %q with ssh client %+v" , p .fileName , temporaryRemotePath , sshClient )
277
277
}
278
278
279
279
// directory on kubernetes-master
@@ -282,31 +282,31 @@ var _ = SIGDescribe("Addon update", func() {
282
282
283
283
// cleanup from previous tests
284
284
_ , _ , _ , err := sshExec (sshClient , fmt .Sprintf ("sudo rm -rf %s" , destinationDirPrefix ))
285
- Expect (err ).NotTo (HaveOccurred (), "Failed to remove remote dir %q with ssh client %+v" , destinationDirPrefix , sshClient )
285
+ gomega . Expect (err ).NotTo (gomega . HaveOccurred (), "Failed to remove remote dir %q with ssh client %+v" , destinationDirPrefix , sshClient )
286
286
287
287
defer sshExec (sshClient , fmt .Sprintf ("sudo rm -rf %s" , destinationDirPrefix )) // ignore result in cleanup
288
288
sshExecAndVerify (sshClient , fmt .Sprintf ("sudo mkdir -p %s" , destinationDir ))
289
289
290
- By ("copy invalid manifests to the destination dir" )
290
+ ginkgo . By ("copy invalid manifests to the destination dir" )
291
291
sshExecAndVerify (sshClient , fmt .Sprintf ("sudo cp %s/%s %s/%s" , temporaryRemotePath , rcInvalid , destinationDir , rcInvalid ))
292
292
// we will verify at the end of the test that the objects weren't created from the invalid manifests
293
293
294
- By ("copy new manifests" )
294
+ ginkgo . By ("copy new manifests" )
295
295
sshExecAndVerify (sshClient , fmt .Sprintf ("sudo cp %s/%s %s/%s" , temporaryRemotePath , rcAddonReconcile , destinationDir , rcAddonReconcile ))
296
296
sshExecAndVerify (sshClient , fmt .Sprintf ("sudo cp %s/%s %s/%s" , temporaryRemotePath , svcAddonDeprecatedLabel , destinationDir , svcAddonDeprecatedLabel ))
297
297
sshExecAndVerify (sshClient , fmt .Sprintf ("sudo cp %s/%s %s/%s" , temporaryRemotePath , svcAddonEnsureExists , destinationDir , svcAddonEnsureExists ))
298
298
// Delete the "ensure exist class" addon at the end.
299
299
defer func () {
300
300
framework .Logf ("Cleaning up ensure exist class addon." )
301
- Expect (f .ClientSet .CoreV1 ().Services (addonNsName ).Delete ("addon-ensure-exists-test" , nil )).NotTo (HaveOccurred ())
301
+ gomega . Expect (f .ClientSet .CoreV1 ().Services (addonNsName ).Delete ("addon-ensure-exists-test" , nil )).NotTo (gomega . HaveOccurred ())
302
302
}()
303
303
304
304
waitForReplicationControllerInAddonTest (f .ClientSet , addonNsName , "addon-reconcile-test" , true )
305
305
waitForServiceInAddonTest (f .ClientSet , addonNsName , "addon-deprecated-label-test" , true )
306
306
waitForServiceInAddonTest (f .ClientSet , addonNsName , "addon-ensure-exists-test" , true )
307
307
308
308
// Replace the manifests with new contents.
309
- By ("update manifests" )
309
+ ginkgo . By ("update manifests" )
310
310
sshExecAndVerify (sshClient , fmt .Sprintf ("sudo cp %s/%s %s/%s" , temporaryRemotePath , rcAddonReconcileUpdated , destinationDir , rcAddonReconcile ))
311
311
sshExecAndVerify (sshClient , fmt .Sprintf ("sudo cp %s/%s %s/%s" , temporaryRemotePath , svcAddonDeprecatedLabelUpdated , destinationDir , svcAddonDeprecatedLabel ))
312
312
sshExecAndVerify (sshClient , fmt .Sprintf ("sudo cp %s/%s %s/%s" , temporaryRemotePath , svcAddonEnsureExistsUpdated , destinationDir , svcAddonEnsureExists ))
@@ -320,7 +320,7 @@ var _ = SIGDescribe("Addon update", func() {
320
320
ensureExistSelector := labels .SelectorFromSet (labels .Set (map [string ]string {"newLabel" : "addon-ensure-exists-test" }))
321
321
waitForServicewithSelectorInAddonTest (f .ClientSet , addonNsName , false , ensureExistSelector )
322
322
323
- By ("remove manifests" )
323
+ ginkgo . By ("remove manifests" )
324
324
sshExecAndVerify (sshClient , fmt .Sprintf ("sudo rm %s/%s" , destinationDir , rcAddonReconcile ))
325
325
sshExecAndVerify (sshClient , fmt .Sprintf ("sudo rm %s/%s" , destinationDir , svcAddonDeprecatedLabel ))
326
326
sshExecAndVerify (sshClient , fmt .Sprintf ("sudo rm %s/%s" , destinationDir , svcAddonEnsureExists ))
@@ -330,9 +330,9 @@ var _ = SIGDescribe("Addon update", func() {
330
330
// "Ensure exist class" addon will not be deleted when manifest is removed.
331
331
waitForServiceInAddonTest (f .ClientSet , addonNsName , "addon-ensure-exists-test" , true )
332
332
333
- By ("verify invalid addons weren't created" )
333
+ ginkgo . By ("verify invalid addons weren't created" )
334
334
_ , err = f .ClientSet .CoreV1 ().ReplicationControllers (addonNsName ).Get ("invalid-addon-test" , metav1.GetOptions {})
335
- Expect (err ).To (HaveOccurred ())
335
+ gomega . Expect (err ).To (gomega . HaveOccurred ())
336
336
337
337
// Invalid addon manifests and the "ensure exist class" addon will be deleted by the deferred function.
338
338
})
@@ -384,8 +384,8 @@ func getMasterSSHClient() (*ssh.Client, error) {
384
384
385
385
func sshExecAndVerify (client * ssh.Client , cmd string ) {
386
386
_ , _ , rc , err := sshExec (client , cmd )
387
- Expect (err ).NotTo (HaveOccurred (), "Failed to execute %q with ssh client %+v" , cmd , client )
388
- Expect (rc ).To (Equal (0 ), "error return code from executing command on the cluster: %s" , cmd )
387
+ gomega . Expect (err ).NotTo (gomega . HaveOccurred (), "Failed to execute %q with ssh client %+v" , cmd , client )
388
+ gomega . Expect (rc ).To (gomega . Equal (0 ), "error return code from executing command on the cluster: %s" , cmd )
389
389
}
390
390
391
391
func sshExec (client * ssh.Client , cmd string ) (string , string , int , error ) {
0 commit comments