-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): support reserved environment variable "APISIX_DEPLOYMENT_E… #8898
Merged
Merged
Changes from 9 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a3b02c5
feat(cli): support reserved environment variable "APISIX_DEPLOYMENT_E…
An-DJ a838987
short str
An-DJ 505d0bf
empty config.yaml
An-DJ d23322e
fix ci error
An-DJ f806562
short msg
An-DJ c39c2dc
remove useless file
An-DJ 652b071
change port
An-DJ 2836520
add check of apisix start
An-DJ 9dbce4e
change " to '
An-DJ 38c3c20
add success test cases
An-DJ 3864738
change test cases
An-DJ 745d554
fix sub-process cannot found env var err
An-DJ b2f75a4
check if the env var is in conf
An-DJ 0ad6e7a
add make stop
An-DJ 549d4e6
remove useless make stop
An-DJ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,6 +211,32 @@ 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:2379" | ||
' > conf/config.yaml | ||
|
||
out=$(APISIX_DEPLOYMENT_ETCD_HOST='["http://127.0.0.1:2333"]' make init 2>&1 || true) | ||
An-DJ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if ! echo "$out" | grep "connection refused" > /dev/null; then | ||
echo "failed: failed to configure etcd host with reserved environment variable" | ||
exit 1 | ||
fi | ||
|
||
out=$(APISIX_DEPLOYMENT_ETCD_HOST='["http://127.0.0.1:2333"]' make run 2>&1 || true) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you configure a connectable address and check if it works? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
if ! echo "$out" | grep "connection refused" > /dev/null; then | ||
echo "failed: failed to configure etcd host with reserved environment variable" | ||
exit 1 | ||
fi | ||
|
||
echo "passed: configure etcd host with reserved environment variable" | ||
|
||
echo ' | ||
nginx_config: | ||
worker_rlimit_nofile: ${{nofile9}} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's an array, let's call it
APISIX_DEPLOYMENT_ETCD_HOSTS
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it is a better idea that the variable name matches the configuration item?
It's easier to be understood, and there is no need to add more detailed documents to describe this feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻 Good point.