Skip to content

Commit 23bae95

Browse files
committed
f
1 parent 01c0760 commit 23bae95

File tree

1 file changed

+1
-49
lines changed

1 file changed

+1
-49
lines changed

test/e2e/scaffold/apisix_deployer.go

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -324,55 +324,7 @@ func (s *APISIXDeployer) closeAdminTunnel() {
324324
}
325325

326326
func (s *APISIXDeployer) CreateAdditionalGateway(namePrefix string) (string, *corev1.Service, error) {
327-
// Create a new namespace for this additional gateway
328-
additionalNS := fmt.Sprintf("%s-%d", namePrefix, time.Now().Unix())
329-
330-
k8s.CreateNamespace(s.t, s.kubectlOptions, additionalNS)
331-
332-
// Create new kubectl options for the new namespace
333-
kubectlOpts := &k8s.KubectlOptions{
334-
ConfigPath: s.runtimeOpts.Kubeconfig,
335-
Namespace: additionalNS,
336-
}
337-
338-
s.Logf("additional gateway in namespace %s", additionalNS)
339-
340-
// Use the same admin key as the main gateway
341-
adminKey := s.runtimeOpts.APISIXAdminAPIKey
342-
s.Logf("additional gateway admin api key: %s", adminKey)
343-
344-
// Store gateway resources info
345-
resources := &GatewayResources{
346-
Namespace: additionalNS,
347-
AdminAPIKey: adminKey,
348-
}
349-
350-
// Deploy dataplane for this additional gateway
351-
opts := APISIXDeployOptions{
352-
Namespace: additionalNS,
353-
AdminKey: adminKey,
354-
ServiceHTTPPort: 9080,
355-
ServiceHTTPSPort: 9443,
356-
}
357-
svc := s.deployDataplane(&opts)
358-
359-
resources.DataplaneService = svc
360-
361-
// Create tunnels for the dataplane
362-
tunnels, err := s.createDataplaneTunnels(svc, kubectlOpts, svc.Name)
363-
if err != nil {
364-
return "", nil, err
365-
}
366-
367-
resources.Tunnels = tunnels
368-
369-
// Use namespace as identifier for APISIX deployments
370-
identifier := additionalNS
371-
372-
// Store in the map
373-
s.additionalGateways[identifier] = resources
374-
375-
return identifier, svc, nil
327+
return s.CreateAdditionalGatewayWithOptions(namePrefix, DeployDataplaneOptions{})
376328
}
377329

378330
func (s *APISIXDeployer) CreateAdditionalGatewayWithOptions(namePrefix string, opts DeployDataplaneOptions) (string, *corev1.Service, error) {

0 commit comments

Comments
 (0)