Skip to content

Run commands when image entrypoint is empty - #2296

Merged
katiewasnothere merged 2 commits into
apple:mainfrom
danielsyauqi:fix/empty-image-entrypoint
Sep 22, 2026
Merged

katiewasnothere merged 2 commits into
apple:mainfrom
danielsyauqi:fix/empty-image-entrypoint

Conversation

@danielsyauqi

Copy link
Copy Markdown
Contributor

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

An image with Entrypoint: [""] currently starts with an empty executable, so container run IMAGE sh fails with failed to find target executable. Treat this value as a cleared image entrypoint so the supplied command, or the image's Cmd, becomes the executable. Explicit command-line entrypoints and non-empty image entrypoints keep their existing behavior.

Fixes #2248.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

Added regression tests for a command supplied on the command line, fallback to the image Cmd, and a normal non-empty image entrypoint. The two empty-entrypoint cases failed before the fix. After the fix, swift test --filter ContainerAPIClientTests passed all 219 tests in 10 suites.

@danielsyauqi danielsyauqi mentioned this pull request Sep 21, 2026
3 tasks done
@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Code Coverage

Tier Line Coverage
Unit 24.98%
Integration 66.76%
Combined 76.22%

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Entrypoint: [""]

2 participants