Skip to content

Commit ae9e27b

Browse files
committed
WIP: fix tests using bare port-numbers
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 7d6e55f commit ae9e27b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

cli/compose/loader/loader.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,10 @@ var transformStringToDuration TransformerFunc = func(value any) (any, error) {
917917
}
918918

919919
func toServicePortConfigs(value string) ([]any, error) {
920+
// If no host-port is specified, historically, we included it as "ephemeral port"
921+
if value != "" && !strings.Contains(value, ":") {
922+
value = "0:" + value
923+
}
920924
// short syntax ([ip:]public:private[/proto])
921925
//
922926
// TODO(thaJeztah): we need an equivalent that handles the "ip-address" part without depending on the nat package.

0 commit comments

Comments
 (0)