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/04/30 03:49:19 UTC

[GitHub] [apisix-ingress-controller] tao12345666333 commented on a change in pull request #414: chore: optimize the apisix cluster processing

tao12345666333 commented on a change in pull request #414:
URL: https://github.com/apache/apisix-ingress-controller/pull/414#discussion_r623569786



##########
File path: pkg/config/config.go
##########
@@ -78,8 +78,18 @@ type KubernetesConfig struct {
 
 // APISIXConfig contains all APISIX related config items.
 type APISIXConfig struct {
-	BaseURL string `json:"base_url" yaml:"base_url"`
+	// DefaultClusterName is the name of default cluster.
+	DefaultClusterName string `json:"default_cluster_name"`
+	// DefaultClusterBaseURL is the base url configuration for the default cluster.
+	DefaultClusterBaseURL string `json:"default_cluster_base_url" yaml:"default_cluster_base_url"`
+	// DefaultClusterAdminKey is the admin key for the default cluster.
 	// TODO: Obsolete the plain way to specify admin_key, which is insecure.
+	DefaultClusterAdminKey string `json:"default_cluster_admin_key" yaml:"default_cluster_admin_key"`
+	// BaseURL is same to DefaultClusterBaseURL.
+	// Deprecated: use DefaultClusterBaseURL instead.
+	BaseURL string `json:"base_url" yaml:"base_url"`

Review comment:
       Should we have a deprecation policy?  e.g. when to actually remove it.

##########
File path: pkg/ingress/controller.go
##########
@@ -318,17 +318,17 @@ func (c *Controller) run(ctx context.Context) {
 	c.metricsCollector.ResetLeader(true)
 
 	err := c.apisix.AddCluster(&apisix.ClusterOptions{
-		Name:     "",
-		AdminKey: c.cfg.APISIX.AdminKey,
-		BaseURL:  c.cfg.APISIX.BaseURL,
+		Name:     c.cfg.APISIX.DefaultClusterName,
+		AdminKey: c.cfg.APISIX.DefaultClusterAdminKey,
+		BaseURL:  c.cfg.APISIX.DefaultClusterBaseURL,

Review comment:
       Is this a breaking change?




-- 
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