gxthrj commented on a change in pull request #416:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/416#discussion_r627331195



##########
File path: test/e2e/scaffold/k8s.go
##########
@@ -193,6 +193,26 @@ func (s *Scaffold) ListApisixUpstreams() ([]*v1.Upstream, 
error) {
        return cli.Cluster("").Upstream().List(context.TODO())
 }
 
+// ListApisixGlobalRules list all global_rules from APISIX
+func (s *Scaffold) ListApisixGlobalRules() ([]*v1.GlobalRule, error) {
+       u := url.URL{
+               Scheme: "http",
+               Host:   s.apisixAdminTunnel.Endpoint(),
+               Path:   "/apisix/admin",
+       }
+       cli, err := apisix.NewClient()
+       if err != nil {
+               return nil, err
+       }
+       err = cli.AddCluster(&apisix.ClusterOptions{
+               BaseURL: u.String(),
+       })
+       if err != nil {
+               return nil, err
+       }
+       return cli.Cluster("").GlobalRule().List(context.TODO())

Review comment:
       Should cluster be got with `DefaultClusterName`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to