Warn user when a named volume is auto-created#1108
Merged
jglogan merged 2 commits intoapple:mainfrom Feb 6, 2026
Merged
Conversation
jglogan
requested changes
Jan 29, 2026
| } | ||
|
|
||
| // TODO: Warn user if named volume was auto-created | ||
| if wasCreated && !parsed.isAnonymous { |
Contributor
There was a problem hiding this comment.
@poetryofcode For output that should go to stderr, use log.warning. You'll need to pass the logger in from the calling command.
Just use named volume was automatically created as the message, and use structured logging: `metadata: [ "name": "(parsed.name)" ]
Look at other log messages in ContainerCommands for examples of this pattern.
Thank you!
Contributor
|
@poetryofcode Could you configure commit signing, rebase your changes onto main, and push this change again? See https://github.com/apple/containerization/blob/main/CONTRIBUTING.md#pull-requests for details on signing. |
When a container references a named volume that doesn't exist, it is silently created. This adds a warning message so users are aware of the implicit resource creation, addressing the TODO in Utility.swift. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace direct print() with structured logging via log.warning, passing the logger from the calling command through to getOrCreateVolume. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
5cdf94b to
53d5995
Compare
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.
Fix applied: Implemented the TODO at
Sources/Services/ContainerAPIService/Client/Utility.swift:358 — warn the
user when a named volume is auto-created.
Previously, when a user ran a container referencing a named volume that
didn't exist, the volume was silently created. Now it prints:
Warning: volume "myvolume" not found, auto-created
This only triggers for named volumes (not anonymous ones), matching
Docker's behavior of informing users about implicit resource creation.