spacewander commented on code in PR #8898:
URL: https://github.com/apache/apisix/pull/8898#discussion_r1119526435


##########
t/cli/test_main.sh:
##########
@@ -211,6 +211,42 @@ fi
 
 echo "passed: resolve variables"
 
+# support reserved environment variable APISIX_DEPLOYMENT_ETCD_HOST
+
+echo '
+deployment:
+  role: traditional
+  role_traditional:
+    config_provider: etcd
+  etcd:
+    host:
+      - "http://127.0.0.1:2333";
+' > conf/config.yaml
+
+failed_msg="failed: failed to configure etcd host with reserved environment 
variable"
+
+out=$(APISIX_DEPLOYMENT_ETCD_HOST='["http://127.0.0.1:2379";]' make init 2>&1 
|| true)
+if echo "$out" | grep "connection refused" > /dev/null; then
+    echo $failed_msg
+    exit 1
+fi
+
+out=$(APISIX_DEPLOYMENT_ETCD_HOST='["http://127.0.0.1:2379";]' make run 2>&1 || 
true)
+if echo "$out" | grep "connection refused" > /dev/null; then
+    echo $failed_msg

Review Comment:
   We should make stop here



##########
t/cli/test_main.sh:
##########
@@ -211,6 +211,42 @@ fi
 
 echo "passed: resolve variables"
 
+# support reserved environment variable APISIX_DEPLOYMENT_ETCD_HOST
+
+echo '
+deployment:
+  role: traditional
+  role_traditional:
+    config_provider: etcd
+  etcd:
+    host:
+      - "http://127.0.0.1:2333";
+' > conf/config.yaml
+
+failed_msg="failed: failed to configure etcd host with reserved environment 
variable"
+
+out=$(APISIX_DEPLOYMENT_ETCD_HOST='["http://127.0.0.1:2379";]' make init 2>&1 
|| true)
+if echo "$out" | grep "connection refused" > /dev/null; then
+    echo $failed_msg
+    exit 1
+fi
+
+out=$(APISIX_DEPLOYMENT_ETCD_HOST='["http://127.0.0.1:2379";]' make run 2>&1 || 
true)
+if echo "$out" | grep "connection refused" > /dev/null; then
+    echo $failed_msg
+    exit 1
+fi
+
+if ! grep "env APISIX_DEPLOYMENT_ETCD_HOST;" conf/nginx.conf > /dev/null; then
+    echo "failed: 'env APISIX_DEPLOYMENT_ETCD_HOST;' not in nginx.conf"
+    echo $failed_msg

Review Comment:
   Ditto



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to