Skip to content

Commit e7e7b0c

Browse files
committed
fix(utils): actually set default port to 80 if missing
1 parent d4bad7f commit e7e7b0c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

utils/FindContainerDefaultPort.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func FindContainerDefaultPort(containerName string) int {
2424
Filters: filters.NewArgs(filters.Arg("label", "Dockport.port")),
2525
})
2626

27-
var containerDefaultPort int
27+
containerDefaultPort := 80
2828
for _, container := range containersWithPortLabel {
2929
cleanName := strings.TrimPrefix(container.Names[0], "/")
3030

@@ -37,10 +37,6 @@ func FindContainerDefaultPort(containerName string) int {
3737
}
3838
break
3939
}
40-
41-
// Set port if container is missing the label
42-
containerDefaultPort = 80
4340
}
44-
4541
return containerDefaultPort
4642
}

0 commit comments

Comments
 (0)