Skip to content

Allow SaveImagesCmd to omit image tags - #2660

Open
HarshDevelops wants to merge 1 commit into
docker-java:mainfrom
HarshDevelops:fix/save-images-optional-tag
Open

Allow SaveImagesCmd to omit image tags#2660
HarshDevelops wants to merge 1 commit into
docker-java:mainfrom
HarshDevelops:fix/save-images-optional-tag

Conversation

@HarshDevelops

Copy link
Copy Markdown

Fixes #1872

What was wrong

SaveImagesCmd documents that an image can be saved without an explicit tag, but withImage(name, tag) rejected a null tag and always formatted images as name:tag. That made the documented name-only form unusable.

What changed

The tag argument is now nullable. TaggedImage.asString() returns the image name alone when no tag is supplied and keeps the existing name:tag form for tagged images. A small unit test covers both forms without requiring a Docker daemon.

Testing

  • mvn -pl docker-java -Dtest=SaveImagesCmdImplTest test
  • mvn -pl docker-java -Dtest='!OkHttpClientTests' test — 366 tests, 0 failures, 2 skipped
  • mvn -pl docker-java -am checkstyle:check
  • git diff --check

The full reactor test command reaches Docker-dependent transport tests, but no Docker daemon is available in this environment, so that part could not run.

@HarshDevelops
HarshDevelops requested a review from a team as a code owner July 19, 2026 07:59
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.

SaveImagesCmd and optional vs. mandatory tag names

1 participant