Skip to content

Commit 824382b

Browse files
committed
chore: remove apisixCli
Signed-off-by: ashing <[email protected]>
1 parent 9a9af12 commit 824382b

File tree

2 files changed

+1
-43
lines changed

2 files changed

+1
-43
lines changed

test/e2e/scaffold/api7_deployer.go

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
package scaffold
1414

1515
import (
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.
214183
func (s *API7Deployer) CreateAdditionalGateway(namePrefix string) (string, string, error) {

test/e2e/scaffold/scaffold.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ type Scaffold struct {
6666

6767
additionalGateways map[string]*GatewayResources
6868

69-
// TODO: move to deployer
70-
apisixCli dashboard.Dashboard
71-
7269
Deployer Deployer
7370
}
7471

@@ -192,15 +189,7 @@ func (s *Scaffold) NewAPISIXHttpsClient(host string) *httpexpect.Expect {
192189
}
193190

194191
func (s *Scaffold) DefaultDataplaneResource() dashboard.Cluster {
195-
return s.apisixCli.Cluster("default")
196-
}
197-
198-
func (s *Scaffold) DefaultDataplaneResourceHTTPS() dashboard.Cluster {
199-
return s.apisixCli.Cluster("default-https")
200-
}
201-
202-
func (s *Scaffold) DataPlaneClient() dashboard.Dashboard {
203-
return s.apisixCli
192+
return nil
204193
}
205194

206195
func (s *Scaffold) DeployTestService() {

0 commit comments

Comments
 (0)