You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/05/06 11:30:59 UTC

[GitHub] [apisix-ingress-controller] tokers commented on a change in pull request #416: feat: add ApisixClusterConfig controller loop

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



##########
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:
       Here we don't need to do this because the cluster is added by ourselves (see the code above this line), which is nameless.




-- 
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:
users@infra.apache.org