-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: can not get hostname in redhat #12267
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
Conversation
Hi @xuruidong, can you create an issue first and include minimal steps to reproduce it? |
done |
Hi @xuruidong, please fix failed ci |
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.
Merging the master branch can make the failed CI pass.
t/core/utils.t
Outdated
ngx.say("hostname: ", hostname) | ||
local hostname2 = core.utils.gethostname() | ||
ngx.say("hostname cached: ", hostname == hostname2) | ||
ngx.say("hostname valid: ", hostname ~= "" and (hostname ~= "unknown" or true)) |
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.
(hostname ~= "unknown" or true) always evaluates to true.
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.
Hi @xuruidong, please have a look.
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.
@Baoyuantop ,please review this. Thank you.
Signed-off-by: xuruidong <[email protected]>
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.
LGTM
Description
I use docker image apache/apisix:3.11.0-redhat , and get an error from the log: "sh: /bin/hostname: No such file or directory"

Which issue(s) this PR fixes:
Fixes #12270
Checklist