Skip to content

KAFKA-19812: Handle missing Docker environment variables - #23045

Open
lh0156 wants to merge 1 commit into
apache:trunkfrom
lh0156:agent/KAFKA-19812-safe-ensure
Open

KAFKA-19812: Handle missing Docker environment variables#23045
lh0156 wants to merge 1 commit into
apache:trunkfrom
lh0156:agent/KAFKA-19812-safe-ensure

Conversation

@lh0156

@lh0156 lh0156 commented Aug 2, 2026

Copy link
Copy Markdown

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.

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>
@github-actions github-actions Bot added docker Official Docker image triage PRs from the community small Small PRs labels Aug 2, 2026
@github-actions

Copy link
Copy Markdown

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Official Docker image needs-attention small Small PRs triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant