diff --git a/test/e2e/apisix/basic.go b/test/e2e/apisix/basic.go index e5c35e544..7231aa3e6 100644 --- a/test/e2e/apisix/basic.go +++ b/test/e2e/apisix/basic.go @@ -34,5 +34,19 @@ var _ = Describe("APISIX Standalone Basic Tests", func() { Expect(). Status(404).Body().Contains("404 Route Not Found") }) + + It("should handle basic HTTP requests with additional gateway", func() { + additionalGatewayID, _, err := s.Deployer.CreateAdditionalGateway("additional-gw") + Expect(err).NotTo(HaveOccurred()) + + httpClient, err := s.NewAPISIXClientForGateway(additionalGatewayID) + Expect(err).NotTo(HaveOccurred()) + Expect(httpClient).NotTo(BeNil()) + + httpClient.GET("/anything"). + Expect(). + Status(404).Body().Contains("404 Route Not Found") + }) + }) }) diff --git a/test/e2e/crds/consumer.go b/test/e2e/crds/consumer.go index 2666a0570..b38d593c1 100644 --- a/test/e2e/crds/consumer.go +++ b/test/e2e/crds/consumer.go @@ -476,13 +476,13 @@ spec: By("create additional gateway group to get new admin key") var err error - additionalGatewayGroupID, _, err = s.CreateAdditionalGatewayGroup("gateway-proxy-update") + additionalGatewayGroupID, _, err = s.Deployer.CreateAdditionalGateway("gateway-proxy-update") Expect(err).NotTo(HaveOccurred(), "creating additional gateway group") - resources, exists := s.GetAdditionalGatewayGroup(additionalGatewayGroupID) + resources, exists := s.GetAdditionalGateway(additionalGatewayGroupID) Expect(exists).To(BeTrue(), "additional gateway group should exist") - client, err := s.NewAPISIXClientForGatewayGroup(additionalGatewayGroupID) + client, err := s.NewAPISIXClientForGateway(additionalGatewayGroupID) Expect(err).NotTo(HaveOccurred(), "creating APISIX client for additional gateway group") By("Consumer not found for additional gateway group") diff --git a/test/e2e/framework/api7_consts.go b/test/e2e/framework/api7_consts.go index b9b447f4d..8d7837fee 100644 --- a/test/e2e/framework/api7_consts.go +++ b/test/e2e/framework/api7_consts.go @@ -38,161 +38,6 @@ var ( TestServerKey string ) -const ( - TestCACert = `-----BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIUBB5PH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az/fj5Itoe7ydEEoYf3s9T+A -yGUb1TQEuANKp/k1If+JQBsAqJBgSaVauIZBf5lBAoGBALew21wK6TvLOxXGRShr -uQTHPT5zwebLvFSoc+7fmdoCuGI04OyGUrJR/uCqXMyyP3xFk7FmkjyavpQc9c+R -+tO3iJEqGvyWC24Bzpy5z9NhdapkXKdju6vmftgBn8SOLOMH9am+EAhwKqfwyNIn -jLSA1vUeTvzS6lIWMGpWq2+q ------END PRIVATE KEY-----` -) - const ( TestCert = `-----BEGIN CERTIFICATE----- MIIC1TCCAb2gAwIBAgIJANm/NDY0xwZUMA0GCSqGSIb3DQEBBQUAMBoxGDAWBgNV diff --git a/test/e2e/framework/api7_dashboard.go b/test/e2e/framework/api7_dashboard.go index 0c16e5b5b..f7e9f6f24 100644 --- a/test/e2e/framework/api7_dashboard.go +++ b/test/e2e/framework/api7_dashboard.go @@ -404,11 +404,11 @@ func (f *Framework) setDpManagerEndpoints() { } func (f *Framework) GetDashboardEndpoint() string { - return f.dashboardHTTPTunnel.Endpoint() + return _dashboardHTTPTunnel.Endpoint() } func (f *Framework) GetDashboardEndpointHTTPS() string { - return f.dashboardHTTPSTunnel.Endpoint() + return _dashboardHTTPSTunnel.Endpoint() } func (f *Framework) DashboardHTTPClient() *httpexpect.Expect { diff --git a/test/e2e/framework/api7_framework.go b/test/e2e/framework/api7_framework.go index b9ed4734b..6aa4620c1 100644 --- a/test/e2e/framework/api7_framework.go +++ b/test/e2e/framework/api7_framework.go @@ -66,7 +66,7 @@ func (f *Framework) BeforeSuite() { time.Sleep(1 * time.Minute) err := f.newDashboardTunnel() - f.Logf("Dashboard HTTP Tunnel:" + f.dashboardHTTPTunnel.Endpoint()) + f.Logf("Dashboard HTTP Tunnel:" + _dashboardHTTPTunnel.Endpoint()) Expect(err).ShouldNot(HaveOccurred(), "creating dashboard tunnel") f.UploadLicense() @@ -84,15 +84,6 @@ func (f *Framework) DeployComponents() { f.initDashboard() } -func (f *Framework) shutdownDashboardTunnel() { - if f.dashboardHTTPTunnel != nil { - f.dashboardHTTPTunnel.Close() - } - if f.dashboardHTTPSTunnel != nil { - f.dashboardHTTPSTunnel.Close() - } -} - func (f *Framework) UploadLicense() { payload := map[string]any{"data": API7EELicense} payloadBytes, err := json.Marshal(payload) @@ -169,6 +160,11 @@ func (f *Framework) initDashboard() { time.Sleep(5 * time.Second) } +var ( + _dashboardHTTPTunnel *k8s.Tunnel + _dashboardHTTPSTunnel *k8s.Tunnel +) + func (f *Framework) newDashboardTunnel() error { var ( httpNodePort int @@ -190,17 +186,26 @@ func (f *Framework) newDashboardTunnel() error { } } - f.dashboardHTTPTunnel = k8s.NewTunnel(f.kubectlOpts, k8s.ResourceTypeService, "api7ee3-dashboard", + _dashboardHTTPTunnel = k8s.NewTunnel(f.kubectlOpts, k8s.ResourceTypeService, "api7ee3-dashboard", httpNodePort, httpPort) - f.dashboardHTTPSTunnel = k8s.NewTunnel(f.kubectlOpts, k8s.ResourceTypeService, "api7ee3-dashboard", + _dashboardHTTPSTunnel = k8s.NewTunnel(f.kubectlOpts, k8s.ResourceTypeService, "api7ee3-dashboard", httpsNodePort, httpsPort) - if err := f.dashboardHTTPTunnel.ForwardPortE(f.GinkgoT); err != nil { + if err := _dashboardHTTPTunnel.ForwardPortE(f.GinkgoT); err != nil { return err } - if err := f.dashboardHTTPSTunnel.ForwardPortE(f.GinkgoT); err != nil { + if err := _dashboardHTTPSTunnel.ForwardPortE(f.GinkgoT); err != nil { return err } return nil } + +func (f *Framework) shutdownDashboardTunnel() { + if _dashboardHTTPTunnel != nil { + _dashboardHTTPTunnel.Close() + } + if _dashboardHTTPSTunnel != nil { + _dashboardHTTPSTunnel.Close() + } +} diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index 0a24249f0..b23251d7b 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -53,10 +53,6 @@ type Framework struct { clientset *kubernetes.Clientset restConfig *rest.Config K8sClient client.Client - - // TODO: remove these tunnels - dashboardHTTPTunnel *k8s.Tunnel - dashboardHTTPSTunnel *k8s.Tunnel } // NewFramework create a global framework with special settings. diff --git a/test/e2e/gatewayapi/httproute.go b/test/e2e/gatewayapi/httproute.go index 9c91b31ef..03dbe5792 100644 --- a/test/e2e/gatewayapi/httproute.go +++ b/test/e2e/gatewayapi/httproute.go @@ -303,12 +303,12 @@ spec: By("Create additional gateway group") var err error - additionalGatewayGroupID, additionalNamespace, err = s.CreateAdditionalGatewayGroup("multi-gw") + additionalGatewayGroupID, additionalNamespace, err = s.Deployer.CreateAdditionalGateway("multi-gw") Expect(err).NotTo(HaveOccurred(), "creating additional gateway group") By("Create additional GatewayProxy") // Get admin key for the additional gateway group - resources, exists := s.GetAdditionalGatewayGroup(additionalGatewayGroupID) + resources, exists := s.GetAdditionalGateway(additionalGatewayGroupID) Expect(exists).To(BeTrue(), "additional gateway group should exist") By("Create additional GatewayClass") @@ -348,7 +348,7 @@ spec: Status(http.StatusOK) By("Access through additional gateway") - client, err := s.NewAPISIXClientForGatewayGroup(additionalGatewayGroupID) + client, err := s.NewAPISIXClientForGateway(additionalGatewayGroupID) Expect(err).NotTo(HaveOccurred(), "creating client for additional gateway") client. @@ -370,7 +370,7 @@ spec: Status(http.StatusOK) By("HTTPRoute should not be accessible through additional gateway") - client, err = s.NewAPISIXClientForGatewayGroup(additionalGatewayGroupID) + client, err = s.NewAPISIXClientForGateway(additionalGatewayGroupID) Expect(err).NotTo(HaveOccurred(), "creating client for additional gateway") client. @@ -1671,13 +1671,13 @@ spec: By("create additional gateway group to get new admin key") var err error - additionalGatewayGroupID, _, err = s.CreateAdditionalGatewayGroup("gateway-proxy-update") + additionalGatewayGroupID, _, err = s.Deployer.CreateAdditionalGateway("gateway-proxy-update") Expect(err).NotTo(HaveOccurred(), "creating additional gateway group") - resources, exists := s.GetAdditionalGatewayGroup(additionalGatewayGroupID) + resources, exists := s.GetAdditionalGateway(additionalGatewayGroupID) Expect(exists).To(BeTrue(), "additional gateway group should exist") - client, err := s.NewAPISIXClientForGatewayGroup(additionalGatewayGroupID) + client, err := s.NewAPISIXClientForGateway(additionalGatewayGroupID) Expect(err).NotTo(HaveOccurred(), "creating APISIX client for additional gateway group") By("HTTPRoute not found for additional gateway group") diff --git a/test/e2e/ingress/ingress.go b/test/e2e/ingress/ingress.go index 422ed6637..f01131924 100644 --- a/test/e2e/ingress/ingress.go +++ b/test/e2e/ingress/ingress.go @@ -831,10 +831,10 @@ spec: Status(200) By("create additional gateway group to get new admin key") - additionalGatewayGroupID, _, err = s.CreateAdditionalGatewayGroup("gateway-proxy-update") + additionalGatewayGroupID, _, err = s.Deployer.CreateAdditionalGateway("gateway-proxy-update") Expect(err).NotTo(HaveOccurred(), "creating additional gateway group") - client, err := s.NewAPISIXClientForGatewayGroup(additionalGatewayGroupID) + client, err := s.NewAPISIXClientForGateway(additionalGatewayGroupID) Expect(err).NotTo(HaveOccurred(), "creating APISIX client for additional gateway group") By("Ingress not found for additional gateway group") @@ -844,7 +844,7 @@ spec: Expect(). Status(404) - resources, exists := s.GetAdditionalGatewayGroup(additionalGatewayGroupID) + resources, exists := s.GetAdditionalGateway(additionalGatewayGroupID) Expect(exists).To(BeTrue(), "additional gateway group should exist") By("update GatewayProxy with new admin key") @@ -965,10 +965,10 @@ spec: Expect().Header("X-Proxy-Test").IsEqual("enabled") By("create additional gateway group to get new admin key") - additionalGatewayGroupID, _, err = s.CreateAdditionalGatewayGroup("gateway-proxy-update") + additionalGatewayGroupID, _, err = s.Deployer.CreateAdditionalGateway("gateway-proxy-update") Expect(err).NotTo(HaveOccurred(), "creating additional gateway group") - client, err := s.NewAPISIXClientForGatewayGroup(additionalGatewayGroupID) + client, err := s.NewAPISIXClientForGateway(additionalGatewayGroupID) Expect(err).NotTo(HaveOccurred(), "creating APISIX client for additional gateway group") By("Ingress not found for additional gateway group") @@ -978,7 +978,7 @@ spec: Expect(). Status(http.StatusNotFound) - resources, exists := s.GetAdditionalGatewayGroup(additionalGatewayGroupID) + resources, exists := s.GetAdditionalGateway(additionalGatewayGroupID) Expect(exists).To(BeTrue(), "additional gateway group should exist") By("update secret") diff --git a/test/e2e/scaffold/api7_deployer.go b/test/e2e/scaffold/api7_deployer.go index a3d97a952..dfafcd4bc 100644 --- a/test/e2e/scaffold/api7_deployer.go +++ b/test/e2e/scaffold/api7_deployer.go @@ -66,7 +66,7 @@ func (s *API7Deployer) BeforeEach() { } // Initialize additionalGatewayGroups map - s.additionalGatewayGroups = make(map[string]*GatewayGroupResources) + s.additionalGateways = make(map[string]*GatewayResources) var nsLabel map[string]string if !s.opts.DisableNamespaceLabel { @@ -113,8 +113,8 @@ func (s *API7Deployer) AfterEach() { } // Delete all additional namespaces - for _, resources := range s.additionalGatewayGroups { - err := s.CleanupAdditionalGatewayGroup(resources.GatewayGroupID) + for identifier := range s.additionalGateways { + err := s.CleanupAdditionalGateway(identifier) Expect(err).NotTo(HaveOccurred(), "cleaning up additional gateway group") } @@ -185,15 +185,15 @@ func (s *API7Deployer) initDataPlaneClient() { s.apisixCli, err = dashboard.NewClient() Expect(err).NotTo(HaveOccurred(), "creating apisix client") - url := fmt.Sprintf("http://%s/apisix/admin", s.GetDashboardEndpoint()) + adminURL := fmt.Sprintf("http://%s/apisix/admin", s.GetDashboardEndpoint()) - s.Logf("apisix admin: %s", url) + s.Logf("apisix admin: %s", adminURL) err = s.apisixCli.AddCluster(context.Background(), &dashboard.ClusterOptions{ Name: "default", ControllerName: s.opts.ControllerName, Labels: map[string]string{"k8s/controller-name": s.opts.ControllerName}, - BaseURL: url, + BaseURL: adminURL, AdminKey: s.AdminKey(), }) Expect(err).NotTo(HaveOccurred(), "adding cluster") @@ -207,3 +207,93 @@ func (s *API7Deployer) initDataPlaneClient() { }) Expect(err).NotTo(HaveOccurred(), "adding cluster") } + +// CreateAdditionalGateway creates a new gateway group and deploys a dataplane for it. +// It returns the gateway group ID and namespace name where the dataplane is deployed. +func (s *API7Deployer) CreateAdditionalGateway(namePrefix string) (string, string, error) { + // Create a new namespace for this gateway group + additionalNS := fmt.Sprintf("%s-%d", namePrefix, time.Now().Unix()) + + // Create namespace with the same labels + var nsLabel map[string]string + if !s.opts.DisableNamespaceLabel { + nsLabel = s.label + } + k8s.CreateNamespaceWithMetadata(s.t, s.kubectlOptions, metav1.ObjectMeta{Name: additionalNS, Labels: nsLabel}) + + // Create new kubectl options for the new namespace + kubectlOpts := &k8s.KubectlOptions{ + ConfigPath: s.opts.Kubeconfig, + Namespace: additionalNS, + } + + // Create a new gateway group + gatewayGroupID := s.CreateNewGatewayGroupWithIngress() + s.Logf("additional gateway group id: %s in namespace %s", gatewayGroupID, additionalNS) + + // Get the admin key for this gateway group + adminKey := s.GetAdminKey(gatewayGroupID) + s.Logf("additional gateway group admin api key: %s", adminKey) + + // Store gateway group info + resources := &GatewayResources{ + Namespace: additionalNS, + AdminAPIKey: adminKey, + } + + serviceName := fmt.Sprintf("api7ee3-apisix-gateway-%s", namePrefix) + + // Deploy dataplane for this gateway group + svc := s.DeployGateway(framework.DataPlaneDeployOptions{ + GatewayGroupID: gatewayGroupID, + Namespace: additionalNS, + Name: serviceName, + ServiceName: serviceName, + DPManagerEndpoint: framework.DPManagerTLSEndpoint, + SetEnv: true, + SSLKey: framework.TestKey, + SSLCert: framework.TestCert, + TLSEnabled: true, + ForIngressGatewayGroup: true, + ServiceHTTPPort: 9080, + ServiceHTTPSPort: 9443, + }) + + resources.DataplaneService = svc + + // Create tunnels for the dataplane + httpTunnel, httpsTunnel, err := s.createDataplaneTunnels(svc, kubectlOpts, serviceName) + if err != nil { + return "", "", err + } + + resources.HttpTunnel = httpTunnel + resources.HttpsTunnel = httpsTunnel + + // Store in the map + s.additionalGateways[gatewayGroupID] = resources + + return gatewayGroupID, additionalNS, nil +} + +// CleanupAdditionalGateway cleans up resources associated with a specific Gateway group +func (s *API7Deployer) CleanupAdditionalGateway(gatewayGroupID string) error { + resources, exists := s.additionalGateways[gatewayGroupID] + if !exists { + return fmt.Errorf("gateway group %s not found", gatewayGroupID) + } + + // Delete the gateway group + s.DeleteGatewayGroup(gatewayGroupID) + + // Delete the namespace + err := k8s.DeleteNamespaceE(s.t, &k8s.KubectlOptions{ + ConfigPath: s.opts.Kubeconfig, + Namespace: resources.Namespace, + }, resources.Namespace) + + // Remove from the map + delete(s.additionalGateways, gatewayGroupID) + + return err +} diff --git a/test/e2e/scaffold/apisix_deployer.go b/test/e2e/scaffold/apisix_deployer.go index 3b4d5eb34..c7254745a 100644 --- a/test/e2e/scaffold/apisix_deployer.go +++ b/test/e2e/scaffold/apisix_deployer.go @@ -71,6 +71,9 @@ func (s *APISIXDeployer) BeforeEach() { s.label["apisix.ingress.watch"] = s.namespace } + // Initialize additionalGateways map + s.additionalGateways = make(map[string]*GatewayResources) + var nsLabel map[string]string if !s.opts.DisableNamespaceLabel { nsLabel = s.label @@ -107,6 +110,12 @@ func (s *APISIXDeployer) AfterEach() { } } + // Delete all additional gateways + for identifier := range s.additionalGateways { + err := s.CleanupAdditionalGateway(identifier) + Expect(err).NotTo(HaveOccurred(), "cleaning up additional gateway") + } + // if the test case is successful, just delete namespace err := k8s.DeleteNamespaceE(s.t, s.kubectlOptions, s.namespace) Expect(err).NotTo(HaveOccurred(), "deleting namespace "+s.namespace) @@ -240,3 +249,90 @@ func (s *APISIXDeployer) createAdminTunnel( return adminTunnel, nil } + +func (s *APISIXDeployer) CreateAdditionalGateway(namePrefix string) (string, string, error) { + // Create a new namespace for this additional gateway + additionalNS := fmt.Sprintf("%s-%d", namePrefix, time.Now().Unix()) + + // Create namespace with the same labels + var nsLabel map[string]string + if !s.opts.DisableNamespaceLabel { + nsLabel = s.label + } + k8s.CreateNamespaceWithMetadata(s.t, s.kubectlOptions, metav1.ObjectMeta{Name: additionalNS, Labels: nsLabel}) + + // Create new kubectl options for the new namespace + kubectlOpts := &k8s.KubectlOptions{ + ConfigPath: s.opts.Kubeconfig, + Namespace: additionalNS, + } + + s.Logf("additional gateway in namespace %s", additionalNS) + + // Use the same admin key as the main gateway + adminKey := s.opts.APISIXAdminAPIKey + s.Logf("additional gateway admin api key: %s", adminKey) + + // Store gateway resources info + resources := &GatewayResources{ + Namespace: additionalNS, + AdminAPIKey: adminKey, + } + + serviceName := fmt.Sprintf("apisix-standalone-%s", namePrefix) + + // Deploy dataplane for this additional gateway + opts := APISIXDeployOptions{ + Namespace: additionalNS, + AdminKey: adminKey, + ServiceName: serviceName, + ServiceHTTPPort: 9080, + ServiceHTTPSPort: 9443, + } + svc := s.deployDataplane(&opts) + + resources.DataplaneService = svc + + // Create tunnels for the dataplane + httpTunnel, httpsTunnel, err := s.createDataplaneTunnels(svc, kubectlOpts, serviceName) + if err != nil { + return "", "", err + } + + resources.HttpTunnel = httpTunnel + resources.HttpsTunnel = httpsTunnel + + // Use namespace as identifier for APISIX deployments + identifier := additionalNS + + // Store in the map + s.additionalGateways[identifier] = resources + + return identifier, additionalNS, nil +} + +func (s *APISIXDeployer) CleanupAdditionalGateway(identifier string) error { + resources, exists := s.additionalGateways[identifier] + if !exists { + return fmt.Errorf("gateway %s not found", identifier) + } + + // Close tunnels if they exist + if resources.HttpTunnel != nil { + resources.HttpTunnel.Close() + } + if resources.HttpsTunnel != nil { + resources.HttpsTunnel.Close() + } + + // Delete the namespace + err := k8s.DeleteNamespaceE(s.t, &k8s.KubectlOptions{ + ConfigPath: s.opts.Kubeconfig, + Namespace: resources.Namespace, + }, resources.Namespace) + + // Remove from the map + delete(s.additionalGateways, identifier) + + return err +} diff --git a/test/e2e/scaffold/deployer.go b/test/e2e/scaffold/deployer.go index aecd5d22e..66b9607af 100644 --- a/test/e2e/scaffold/deployer.go +++ b/test/e2e/scaffold/deployer.go @@ -20,6 +20,8 @@ type Deployer interface { ScaleIngress(replicas int) BeforeEach() AfterEach() + CreateAdditionalGateway(namePrefix string) (string, string, error) + CleanupAdditionalGateway(identifier string) error } var NewDeployer func(*Scaffold) Deployer diff --git a/test/e2e/scaffold/scaffold.go b/test/e2e/scaffold/scaffold.go index 05379ad6a..47e785fbf 100644 --- a/test/e2e/scaffold/scaffold.go +++ b/test/e2e/scaffold/scaffold.go @@ -20,7 +20,6 @@ import ( "net/url" "os" "strings" - "time" "github.com/gavv/httpexpect/v2" "github.com/gruntwork-io/terratest/modules/k8s" @@ -62,22 +61,19 @@ type Scaffold struct { finalizers []func() label map[string]string - // TODO: move to deployer - apisixCli dashboard.Dashboard - apisixHttpTunnel *k8s.Tunnel apisixHttpsTunnel *k8s.Tunnel - // Support for multiple Gateway groups + additionalGateways map[string]*GatewayResources + // TODO: move to deployer - additionalGatewayGroups map[string]*GatewayGroupResources + apisixCli dashboard.Dashboard Deployer Deployer } -// GatewayGroupResources contains resources associated with a specific Gateway group -type GatewayGroupResources struct { - GatewayGroupID string +// GatewayResources contains resources associated with a specific Gateway group +type GatewayResources struct { Namespace string DataplaneService *corev1.Service HttpTunnel *k8s.Tunnel @@ -285,75 +281,6 @@ func (s *Scaffold) GetControllerName() string { return s.opts.ControllerName } -// CreateAdditionalGatewayGroup creates a new gateway group and deploys a dataplane for it. -// It returns the gateway group ID and namespace name where the dataplane is deployed. -func (s *Scaffold) CreateAdditionalGatewayGroup(namePrefix string) (string, string, error) { - // Create a new namespace for this gateway group - additionalNS := fmt.Sprintf("%s-%d", namePrefix, time.Now().Unix()) - - // Create namespace with the same labels - var nsLabel map[string]string - if !s.opts.DisableNamespaceLabel { - nsLabel = s.label - } - k8s.CreateNamespaceWithMetadata(s.t, s.kubectlOptions, metav1.ObjectMeta{Name: additionalNS, Labels: nsLabel}) - - // Create new kubectl options for the new namespace - kubectlOpts := &k8s.KubectlOptions{ - ConfigPath: s.opts.Kubeconfig, - Namespace: additionalNS, - } - - // Create a new gateway group - gatewayGroupID := s.CreateNewGatewayGroupWithIngress() - s.Logf("additional gateway group id: %s in namespace %s", gatewayGroupID, additionalNS) - - // Get the admin key for this gateway group - adminKey := s.GetAdminKey(gatewayGroupID) - s.Logf("additional gateway group admin api key: %s", adminKey) - - // Store gateway group info - resources := &GatewayGroupResources{ - GatewayGroupID: gatewayGroupID, - Namespace: additionalNS, - AdminAPIKey: adminKey, - } - - serviceName := fmt.Sprintf("api7ee3-apisix-gateway-%s", namePrefix) - - // Deploy dataplane for this gateway group - svc := s.DeployGateway(framework.DataPlaneDeployOptions{ - GatewayGroupID: gatewayGroupID, - Namespace: additionalNS, - Name: serviceName, - ServiceName: serviceName, - DPManagerEndpoint: framework.DPManagerTLSEndpoint, - SetEnv: true, - SSLKey: framework.TestKey, - SSLCert: framework.TestCert, - TLSEnabled: true, - ForIngressGatewayGroup: true, - ServiceHTTPPort: 9080, - ServiceHTTPSPort: 9443, - }) - - resources.DataplaneService = svc - - // Create tunnels for the dataplane - httpTunnel, httpsTunnel, err := s.createDataplaneTunnels(svc, kubectlOpts, serviceName) - if err != nil { - return "", "", err - } - - resources.HttpTunnel = httpTunnel - resources.HttpsTunnel = httpsTunnel - - // Store in the map - s.additionalGatewayGroups[gatewayGroupID] = resources - - return gatewayGroupID, additionalNS, nil -} - // createDataplaneTunnels creates HTTP and HTTPS tunnels for a dataplane service. // It's extracted from newAPISIXTunnels to be reusable for additional gateway groups. func (s *Scaffold) createDataplaneTunnels( @@ -398,17 +325,17 @@ func (s *Scaffold) createDataplaneTunnels( return httpTunnel, httpsTunnel, nil } -// GetAdditionalGatewayGroup returns resources associated with a specific Gateway group -func (s *Scaffold) GetAdditionalGatewayGroup(gatewayGroupID string) (*GatewayGroupResources, bool) { - resources, exists := s.additionalGatewayGroups[gatewayGroupID] +// GetAdditionalGateway returns resources associated with a specific gateway +func (s *Scaffold) GetAdditionalGateway(identifier string) (*GatewayResources, bool) { + resources, exists := s.additionalGateways[identifier] return resources, exists } -// NewAPISIXClientForGatewayGroup creates an HTTP client for a specific Gateway group -func (s *Scaffold) NewAPISIXClientForGatewayGroup(gatewayGroupID string) (*httpexpect.Expect, error) { - resources, exists := s.additionalGatewayGroups[gatewayGroupID] +// NewAPISIXClientForGateway creates an HTTP client for a specific gateway +func (s *Scaffold) NewAPISIXClientForGateway(identifier string) (*httpexpect.Expect, error) { + resources, exists := s.additionalGateways[identifier] if !exists { - return nil, fmt.Errorf("gateway group %s not found", gatewayGroupID) + return nil, fmt.Errorf("gateway %s not found", identifier) } u := url.URL{ @@ -429,11 +356,11 @@ func (s *Scaffold) NewAPISIXClientForGatewayGroup(gatewayGroupID string) (*httpe }), nil } -// NewAPISIXHttpsClientForGatewayGroup creates an HTTPS client for a specific Gateway group -func (s *Scaffold) NewAPISIXHttpsClientForGatewayGroup(gatewayGroupID string, host string) (*httpexpect.Expect, error) { - resources, exists := s.additionalGatewayGroups[gatewayGroupID] +// NewAPISIXHttpsClientForGateway creates an HTTPS client for a specific gateway +func (s *Scaffold) NewAPISIXHttpsClientForGateway(identifier string, host string) (*httpexpect.Expect, error) { + resources, exists := s.additionalGateways[identifier] if !exists { - return nil, fmt.Errorf("gateway group %s not found", gatewayGroupID) + return nil, fmt.Errorf("gateway %s not found", identifier) } u := url.URL{ @@ -457,43 +384,21 @@ func (s *Scaffold) NewAPISIXHttpsClientForGatewayGroup(gatewayGroupID string, ho }), nil } -// CleanupAdditionalGatewayGroup cleans up resources associated with a specific Gateway group -func (s *Scaffold) CleanupAdditionalGatewayGroup(gatewayGroupID string) error { - resources, exists := s.additionalGatewayGroups[gatewayGroupID] - if !exists { - return fmt.Errorf("gateway group %s not found", gatewayGroupID) - } - - // Delete the gateway group - s.DeleteGatewayGroup(gatewayGroupID) - - // Delete the namespace - err := k8s.DeleteNamespaceE(s.t, &k8s.KubectlOptions{ - ConfigPath: s.opts.Kubeconfig, - Namespace: resources.Namespace, - }, resources.Namespace) - - // Remove from the map - delete(s.additionalGatewayGroups, gatewayGroupID) - - return err -} - -// GetGatewayGroupHTTPEndpoint returns the HTTP endpoint for a specific Gateway group -func (s *Scaffold) GetGatewayGroupHTTPEndpoint(gatewayGroupID string) (string, error) { - resources, exists := s.additionalGatewayGroups[gatewayGroupID] +// GetGatewayHTTPEndpoint returns the HTTP endpoint for a specific gateway +func (s *Scaffold) GetGatewayHTTPEndpoint(identifier string) (string, error) { + resources, exists := s.additionalGateways[identifier] if !exists { - return "", fmt.Errorf("gateway group %s not found", gatewayGroupID) + return "", fmt.Errorf("gateway %s not found", identifier) } return resources.HttpTunnel.Endpoint(), nil } -// GetGatewayGroupHTTPSEndpoint returns the HTTPS endpoint for a specific Gateway group -func (s *Scaffold) GetGatewayGroupHTTPSEndpoint(gatewayGroupID string) (string, error) { - resources, exists := s.additionalGatewayGroups[gatewayGroupID] +// GetGatewayHTTPSEndpoint returns the HTTPS endpoint for a specific gateway +func (s *Scaffold) GetGatewayHTTPSEndpoint(identifier string) (string, error) { + resources, exists := s.additionalGateways[identifier] if !exists { - return "", fmt.Errorf("gateway group %s not found", gatewayGroupID) + return "", fmt.Errorf("gateway %s not found", identifier) } return resources.HttpsTunnel.Endpoint(), nil