-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Source additional files correctly in elasticsearch-cli #40890
Conversation
Since we only source additional sources from the same dir as our cli scripts, resolve the path relevant to $ES_HOME Resolves: elastic#40889
Pinging @elastic/es-core-infra |
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.
I left some questions.
@@ -7,7 +7,7 @@ source "`dirname "$0"`"/elasticsearch-env | |||
IFS=';' read -r -a additional_sources <<< "$ES_ADDITIONAL_SOURCES" | |||
for additional_source in "${additional_sources[@]}" | |||
do | |||
source "`dirname "$0"`"/$additional_source | |||
source $ES_HOME/bin/$additional_source |
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.
We probably need quotes here since ES_HOME could have spaces. Can you verify this, and quote if needed.
Also, does Windows have the same problem and need a fix too?
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.
Also, does Windows have the same problem and need a fix too?
we use:
if defined ES_ADDITIONAL_SOURCES (
for %%a in ("%ES_ADDITIONAL_SOURCES:;=","%") do (
call "%~dp0%%a"
)
)
%~dp0
will always expand to the full path where the batch file is located and not one relative to where the batch script is executed from, so it will not be affected by the cd that happens when we source elasticsearch-env.bat
. That said, I'd have nothing against a manual confirmation, I don't have access to a windows machine right now :/
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.
That looks right to me, thanks for checking.
Can we add a packaging test for this? How about one that from not ES_HOME loops through each tool and tries to invoke help on them? That would fail before this change, and succeed after? |
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.
@elasticmachine run elasticsearch-ci/2 ( we hit the issue that #40658 hopefully addresses) |
Since we only source additional sources from the same dir as our cli scripts, resolve the path relevant to $ES_HOME
Since we only source additional sources from the same dir as our cli scripts, resolve the path relevant to $ES_HOME
* master: (63 commits) Suppress lease background sync failures if stopping (elastic#40902) [DOCS] Added settings page for ILM. (elastic#40880) [Docs] Remove extraneous text (elastic#40914) Move test classes to test root in Painless (elastic#40873) Fix date index name processor default date_formats (elastic#40915) Source additional files correctly in elasticsearch-cli (elastic#40890) Allow AVX-512 on JDK 11+ (elastic#40828) [Docs] Change example to show col headers (elastic#40822) Update apache httpclient to version 4.5.8 (elastic#40875) Update monitoring-kibana.json (elastic#40899) Introduce Delegating ActionListener Wrappers (elastic#40129) Deprecate old transport settings (elastic#40821) Add Kibana application privileges for monitoring and ml reserved roles (elastic#40651) Use Writeable for TransportReplAction derivatives (elastic#40894) Add test for HTTP and Transport TLS on basic license (elastic#40714) Remove unneded cluster config from test (elastic#40856) Make Fuzziness reject illegal values earlier (elastic#33511) Remove test-only customisation from TransReplAct (elastic#40863) Fix dense/sparse vector limit documentation (elastic#40852) Make -try xlint warning disabled by default. (elastic#40833) ...
* master: (77 commits) Suppress lease background sync failures if stopping (elastic#40902) [DOCS] Added settings page for ILM. (elastic#40880) [Docs] Remove extraneous text (elastic#40914) Move test classes to test root in Painless (elastic#40873) Fix date index name processor default date_formats (elastic#40915) Source additional files correctly in elasticsearch-cli (elastic#40890) Allow AVX-512 on JDK 11+ (elastic#40828) [Docs] Change example to show col headers (elastic#40822) Update apache httpclient to version 4.5.8 (elastic#40875) Update monitoring-kibana.json (elastic#40899) Introduce Delegating ActionListener Wrappers (elastic#40129) Deprecate old transport settings (elastic#40821) Add Kibana application privileges for monitoring and ml reserved roles (elastic#40651) Use Writeable for TransportReplAction derivatives (elastic#40894) Add test for HTTP and Transport TLS on basic license (elastic#40714) Remove unneded cluster config from test (elastic#40856) Make Fuzziness reject illegal values earlier (elastic#33511) Remove test-only customisation from TransReplAct (elastic#40863) Fix dense/sparse vector limit documentation (elastic#40852) Make -try xlint warning disabled by default. (elastic#40833) ...
Since we only source additional sources from the same dir as our cli scripts, resolve the path relevant to $ES_HOME
Since we only source additional sources from the same dir as our
cli scripts, resolve the path relevant to $ES_HOME
Resolves: #40889