1313package scaffold
1414
1515import (
16- "context"
1716 "fmt"
1817 "os"
1918 "time"
@@ -24,7 +23,6 @@ import (
2423 corev1 "k8s.io/api/core/v1"
2524 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2625
27- "github.com/apache/apisix-ingress-controller/pkg/dashboard"
2826 "github.com/apache/apisix-ingress-controller/pkg/utils"
2927 "github.com/apache/apisix-ingress-controller/test/e2e/framework"
3028)
@@ -90,7 +88,6 @@ func (s *API7Deployer) BeforeEach() {
9088 e .Add (func () {
9189 s .DeployDataplane ()
9290 s .DeployIngress ()
93- s .initDataPlaneClient ()
9491 })
9592 e .Add (s .DeployTestService )
9693 e .Wait ()
@@ -181,34 +178,6 @@ func (s *API7Deployer) ScaleIngress(replicas int) {
181178 })
182179}
183180
184- func (s * API7Deployer ) initDataPlaneClient () {
185- var err error
186- s .apisixCli , err = dashboard .NewClient ()
187- Expect (err ).NotTo (HaveOccurred (), "creating apisix client" )
188-
189- adminURL := fmt .Sprintf ("http://%s/apisix/admin" , s .GetDashboardEndpoint ())
190-
191- s .Logf ("apisix admin: %s" , adminURL )
192-
193- err = s .apisixCli .AddCluster (context .Background (), & dashboard.ClusterOptions {
194- Name : "default" ,
195- ControllerName : s .opts .ControllerName ,
196- Labels : map [string ]string {"k8s/controller-name" : s .opts .ControllerName },
197- BaseURL : adminURL ,
198- AdminKey : s .AdminKey (),
199- })
200- Expect (err ).NotTo (HaveOccurred (), "adding cluster" )
201-
202- httpsURL := fmt .Sprintf ("https://%s/apisix/admin" , s .GetDashboardEndpointHTTPS ())
203- err = s .apisixCli .AddCluster (context .Background (), & dashboard.ClusterOptions {
204- Name : "default-https" ,
205- BaseURL : httpsURL ,
206- AdminKey : s .AdminKey (),
207- SkipTLSVerify : true ,
208- })
209- Expect (err ).NotTo (HaveOccurred (), "adding cluster" )
210- }
211-
212181// CreateAdditionalGateway creates a new gateway group and deploys a dataplane for it.
213182// It returns the gateway group ID and namespace name where the dataplane is deployed.
214183func (s * API7Deployer ) CreateAdditionalGateway (namePrefix string ) (string , string , error ) {
0 commit comments