diff --git a/pkg/loader/compose/compose.go b/pkg/loader/compose/compose.go index 80b8e0b4..97396243 100644 --- a/pkg/loader/compose/compose.go +++ b/pkg/loader/compose/compose.go @@ -288,7 +288,6 @@ func loadPorts(ports []types.ServicePortConfig, expose []string) []kobject.Ports continue } komposePorts = append(komposePorts, kobject.Ports{ - HostPort: cast.ToInt32(portValue), ContainerPort: cast.ToInt32(portValue), HostIP: "", Protocol: strings.ToUpper(protocol), diff --git a/pkg/loader/compose/compose_test.go b/pkg/loader/compose/compose_test.go index 0ba33a36..eb002e11 100644 --- a/pkg/loader/compose/compose_test.go +++ b/pkg/loader/compose/compose_test.go @@ -221,7 +221,7 @@ func TestLoadV3Ports(t *testing.T) { expose: []string{"80", "8080"}, want: []kobject.Ports{ {HostPort: 80, ContainerPort: 80, Protocol: string(api.ProtocolTCP)}, - {HostPort: 8080, ContainerPort: 8080, Protocol: string(api.ProtocolTCP)}, + {ContainerPort: 8080, Protocol: string(api.ProtocolTCP)}, }, }, { @@ -230,7 +230,7 @@ func TestLoadV3Ports(t *testing.T) { expose: []string{"80/udp"}, want: []kobject.Ports{ {HostPort: 80, ContainerPort: 80, Protocol: string(api.ProtocolTCP)}, - {HostPort: 80, ContainerPort: 80, Protocol: string(api.ProtocolUDP)}, + {ContainerPort: 80, Protocol: string(api.ProtocolUDP)}, }, }, } { @@ -347,8 +347,8 @@ func TestLoadPorts(t *testing.T) { want: []kobject.Ports{ {ContainerPort: 80, Protocol: string(api.ProtocolTCP)}, {ContainerPort: 3000, Protocol: string(api.ProtocolTCP)}, - {HostPort: 80, ContainerPort: 80, Protocol: string(api.ProtocolTCP)}, - {HostPort: 8080, ContainerPort: 8080, Protocol: string(api.ProtocolTCP)}, + {ContainerPort: 80, Protocol: string(api.ProtocolTCP)}, + {ContainerPort: 8080, Protocol: string(api.ProtocolTCP)}, }, }, }