KAFKA-19812: Handle missing Docker environment variables - #23045
Open
lh0156 wants to merge 1 commit into
Open
Conversation
Use a nounset-safe indirect expansion when validating environment variables in the Docker configure script. Add regression tests for missing and empty variables and run them with the Docker sanity suite.\n\nGenerated-by: OpenAI Codex (GPT-5)\nSigned-off-by: Yunseop Eom <62834176+lh0156@users.noreply.github.com>
|
A label of 'needs-attention' was automatically added to this PR in order to raise the |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes KAFKA-19812
Summary
configurescript's indirect environment-variable lookup safe withbash -u.When the Docker entrypoint runs with
set -u,${!1}raises an unbound-variable error beforeensurecan 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_testbash -n docker/resources/common-scripts/configurepython3 -m py_compile docker/test/common_scripts_test.py docker/test/docker_sanity_test.pygit diff --checkThe regression test was verified to fail on the base branch with the
!1: unbound variableerror, then pass after the fix.