fix(publish): accept short-form port mappings (fixes #13672)#13849
Open
Ijtihed wants to merge 1 commit into
Open
fix(publish): accept short-form port mappings (fixes #13672)#13849Ijtihed wants to merge 1 commit into
Ijtihed wants to merge 1 commit into
Conversation
|
i have one question regarding coverage: ports:
- "8080:80"
- "127.0.0.1:8080:80"
- "${PORT:-8080}:80"It may be worth adding or extending tests to cover a few representative short-form variants to ensure the publish path remains aligned with Compose port syntax support |
Signed-off-by: Ijtihed Kilani <ijtihedk@gmail.com>
c8cdd16 to
523c51c
Compare
Author
Agree. |
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.
What I did
docker compose publishfailed with'services[whoami].ports[0]' expected a map or struct, got "string"when a service used short-form port syntax like${DASHBOARD_PORT:-3000}:3000.composeFileAsByteReaderusedLoadWithContextwhich decodes ports into typed Go structs which rejects short-form string entries. Switching toLoadModelWithContextreturns a raw map instead which in ths case avoids the struct decodeRelated issue
Fixes #13672