@@ -40,14 +40,14 @@ func DeployAppToxiSpec(ctx context.Context, inputGetter func() CommonSpecInput)
40
40
namespace * corev1.Namespace
41
41
cancelWatches context.CancelFunc
42
42
clusterResources * clusterctl.ApplyClusterTemplateAndWaitResult
43
- appName = "httpd"
44
- appManifestPath = "data/fixture/sample-application.yaml"
45
- expectedHtmlPath = "data/fixture/expected-webpage.html"
46
- appDeploymentReadyTimeout = 180
47
- appPort = 8080
48
- appDefaultHtmlPath = "/"
49
- expectedHtml = ""
50
- toxiProxy * helpers.ToxiProxy = nil
43
+ appName = "httpd"
44
+ appManifestPath = "data/fixture/sample-application.yaml"
45
+ expectedHtmlPath = "data/fixture/expected-webpage.html"
46
+ appDeploymentReadyTimeout = 180
47
+ appPort = 8080
48
+ appDefaultHtmlPath = "/"
49
+ expectedHtml = ""
50
+ toxiProxyContext * helpers.ToxiProxyContext = nil
51
51
toxicName string
52
52
)
53
53
@@ -64,7 +64,7 @@ func DeployAppToxiSpec(ctx context.Context, inputGetter func() CommonSpecInput)
64
64
Expect (input .E2EConfig .Variables ).To (HaveKey (KubernetesVersion ))
65
65
66
66
// Setup a toxiProxy for this test.
67
- toxiProxy := helpers .SetupForToxiproxyTesting (ctx , input .BootstrapClusterProxy )
67
+ toxiProxy := helpers .SetupForToxiproxyTesting (input .BootstrapClusterProxy )
68
68
toxicName = toxiProxy .AddLatencyToxic (100 , 10 , 100 , false )
69
69
70
70
// Setup a Namespace where to host objects for this spec and create a watcher for the namespace events.
@@ -87,12 +87,12 @@ func DeployAppToxiSpec(ctx context.Context, inputGetter func() CommonSpecInput)
87
87
clusterName := fmt .Sprintf ("%s-%s" , specName , util .RandomString (6 ))
88
88
89
89
clusterctl .ApplyClusterTemplateAndWait (ctx , clusterctl.ApplyClusterTemplateAndWaitInput {
90
- ClusterProxy : toxiProxy .ClusterProxy ,
90
+ ClusterProxy : toxiProxyContext .ClusterProxy ,
91
91
CNIManifestPath : input .E2EConfig .GetVariable (CNIPath ),
92
92
ConfigCluster : clusterctl.ConfigClusterInput {
93
- LogFolder : filepath .Join (input .ArtifactFolder , "clusters" , toxiProxy .ClusterProxy .GetName ()),
93
+ LogFolder : filepath .Join (input .ArtifactFolder , "clusters" , toxiProxyContext .ClusterProxy .GetName ()),
94
94
ClusterctlConfigPath : input .ClusterctlConfigPath ,
95
- KubeconfigPath : toxiProxy .ClusterProxy .GetKubeconfigPath (),
95
+ KubeconfigPath : toxiProxyContext .ClusterProxy .GetKubeconfigPath (),
96
96
InfrastructureProvider : clusterctl .DefaultInfrastructureProvider ,
97
97
Flavor : flavor ,
98
98
Namespace : namespace ,
@@ -106,7 +106,7 @@ func DeployAppToxiSpec(ctx context.Context, inputGetter func() CommonSpecInput)
106
106
WaitForMachineDeployments : input .E2EConfig .GetIntervals (specName , "wait-worker-nodes" ),
107
107
}, clusterResources )
108
108
109
- workloadClusterProxy := toxiProxy .ClusterProxy .GetWorkloadCluster (ctx , namespace , clusterName )
109
+ workloadClusterProxy := toxiProxyContext .ClusterProxy .GetWorkloadCluster (ctx , namespace , clusterName )
110
110
workloadKubeconfigPath := workloadClusterProxy .GetKubeconfigPath ()
111
111
112
112
appManifestAbsolutePath , _ := filepath .Abs (appManifestPath )
@@ -136,10 +136,10 @@ func DeployAppToxiSpec(ctx context.Context, inputGetter func() CommonSpecInput)
136
136
137
137
AfterEach (func () {
138
138
// Dumps all the resources in the spec namespace, then cleanups the cluster object and the spec namespace itself.
139
- dumpSpecResourcesAndCleanup (ctx , specName , toxiProxy .ClusterProxy , input .ArtifactFolder , namespace , cancelWatches , clusterResources .Cluster , input .E2EConfig .GetIntervals , input .SkipCleanup )
139
+ dumpSpecResourcesAndCleanup (ctx , specName , toxiProxyContext .ClusterProxy , input .ArtifactFolder , namespace , cancelWatches , clusterResources .Cluster , input .E2EConfig .GetIntervals , input .SkipCleanup )
140
140
141
141
// Tear down the proxy
142
- toxiProxy .RemoveToxic (toxicName )
143
- helpers .TearDownToxiProxy (ctx , toxiProxy )
142
+ toxiProxyContext .RemoveToxic (toxicName )
143
+ helpers .TearDownToxiProxy (toxiProxyContext )
144
144
})
145
145
}
0 commit comments