Skip to content

fix: add validation and logging to entrypoint.sh#42

Merged
mrhillsman merged 1 commit into
mainfrom
fix/improve-entrypoint-validation-and-logging
May 21, 2026
Merged

fix: add validation and logging to entrypoint.sh#42
mrhillsman merged 1 commit into
mainfrom
fix/improve-entrypoint-validation-and-logging

Conversation

@mrhillsman

Copy link
Copy Markdown
Contributor

Add command validation, operational logging, and document variable handling constraints in entrypoint.sh to improve debuggability and prevent silent failures in pod deployments.

Changes:

  • Validate VIRTWORK_COMMAND is 'run' or 'cleanup', exit with error otherwise
  • Log command being executed before exec for debugging pod startup
  • Add shellcheck disable comment for intentional unquoted expansion
  • Document VIRTWORK_ARGS constraint: must be space-delimited tokens
  • Add [entrypoint] prefix to all log messages for clarity

VIRTWORK_ARGS remains unquoted to enable space-delimited tokenization (e.g., "--workloads cpu,memory --vm-count 2"). This means argument values cannot contain spaces. This constraint is acceptable for container environment variables and is now documented.

Fixes #12

Add command validation, operational logging, and document variable
handling constraints in entrypoint.sh to improve debuggability and
prevent silent failures in pod deployments.

Changes:
- Validate VIRTWORK_COMMAND is 'run' or 'cleanup', exit with error otherwise
- Log command being executed before exec for debugging pod startup
- Add shellcheck disable comment for intentional unquoted expansion
- Document VIRTWORK_ARGS constraint: must be space-delimited tokens
- Add [entrypoint] prefix to all log messages for clarity

VIRTWORK_ARGS remains unquoted to enable space-delimited tokenization
(e.g., "--workloads cpu,memory --vm-count 2"). This means argument
values cannot contain spaces. This constraint is acceptable for
container environment variables and is now documented.

Fixes #12

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
@exe-prow-github-app

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mrhillsman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@exe-prow-github-app exe-prow-github-app Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 20, 2026
@mrhillsman

Copy link
Copy Markdown
Contributor Author
> podman run --rm -e VIRTWORK_COMMAND=hello quay.io/opdev/virtwork:latest
[entrypoint] ERROR: Invalid VIRTWORK_COMMAND='hello'. Must be 'run' or 'cleanup'.

@mrhillsman
mrhillsman merged commit 57915d9 into main May 21, 2026
3 of 4 checks passed
@mrhillsman
mrhillsman deleted the fix/improve-entrypoint-validation-and-logging branch May 22, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: entrypoint.sh has unquoted variable expansion and missing operational logging

1 participant