Skip to content

Commit 7b0ef7a

Browse files
committed
e2e: restore secret name to original while running tests with ToxiProxy
The e2e test network_interruption_toxi.go failed with message below, which is because the default secretname has been updated to secret1-toxiproxy in deploy_app_toxi.go. 09:09:18 ␛[91mExpected 09:09:18 <*errors.StatusError | 0xc00095b9a0>: { 09:09:18 ErrStatus: { 09:09:18 TypeMeta: {Kind: "", APIVersion: ""}, 09:09:18 ListMeta: { 09:09:18 SelfLink: "", 09:09:18 ResourceVersion: "", 09:09:18 Continue: "", 09:09:18 RemainingItemCount: nil, 09:09:18 }, 09:09:18 Status: "Failure", 09:09:18 Message: "secrets \"secret1-toxiproxy\" not found", 09:09:18 Reason: "NotFound", 09:09:18 Details: { 09:09:18 Name: "secret1-toxiproxy", 09:09:18 Group: "", 09:09:18 Kind: "secrets", 09:09:18 UID: "", 09:09:18 Causes: nil, 09:09:18 RetryAfterSeconds: 0, 09:09:18 }, 09:09:18 Code: 404, 09:09:18 }, 09:09:18 } 09:09:18 to be nil␛[0m This happened with deploy_app_toxi.go sometimes, if network_interruption_toxi.go is run before it.
1 parent 4e33b4a commit 7b0ef7a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/e2e/toxiproxy/toxiProxy.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,13 @@ func SetupForToxiProxyTestingACS(ctx context.Context, clusterName string, cluste
203203
Expect(err).To(BeNil())
204204

205205
// Override the test config to use this alternate cloud-config secret
206+
originalSecretName := e2eConfig.GetVariable("CLOUDSTACK_FD1_SECRET_NAME")
206207
e2eConfig.Variables["CLOUDSTACK_FD1_SECRET_NAME"] = toxiProxyFdEndpointSecret.Name
207208

208209
// Overriding e2e config file into a new temp copy, so as not to inadvertently override the other e2e tests.
209210
newConfigFilePath := fmt.Sprintf("/tmp/%v.yaml", toxiProxyName)
210211
editConfigFile(newConfigFilePath, configPath, "CLOUDSTACK_FD1_SECRET_NAME", toxiProxyFdEndpointSecret.Name)
212+
e2eConfig.Variables["CLOUDSTACK_FD1_SECRET_NAME"] = originalSecretName
211213

212214
// Return a context
213215
return &Context{

0 commit comments

Comments
 (0)