lh0156 opened a new pull request, #23045:
URL: https://github.com/apache/kafka/pull/23045
Closes KAFKA-19812
### Summary
- Make the Docker `configure` script's indirect environment-variable lookup
safe with `bash -u`.
- Preserve the existing validation for both unset and empty variables.
- Add regression tests for the user-facing error message and include them in
the Docker sanity test runner.
When the Docker entrypoint runs with `set -u`, `${!1}` raises an
unbound-variable error before `ensure` can report which required variable is
missing. Using the nounset-safe form `${!1-}` keeps the validation behavior
intact while making the diagnostic actionable.
### Tests
- `python3 -m unittest docker.test.common_scripts_test`
- `bash -n docker/resources/common-scripts/configure`
- `python3 -m py_compile docker/test/common_scripts_test.py
docker/test/docker_sanity_test.py`
- `git diff --check`
The regression test was verified to fail on the base branch with the `!1:
unbound variable` error, then pass after the fix.
--
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]