Skip to content

Commit

Permalink
rename podman GenericPort
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Jun 23, 2023
1 parent 1674834 commit 1e5fd39
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions runtime/podman/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,12 @@ func (r *PodmanRuntime) produceGenericContainerList(ctx context.Context,
Labels: v.Labels,
Pid: v.Pid,
NetworkSettings: netSettings,
Ports: []*types.GenericPort{},
Ports: []*types.GenericPortBinding{},
}

// convert the exposed ports the GenericPorts and add them to the GenericContainer
for _, p := range cList[i].Ports {
genericList[i].Ports = append(genericList[i].Ports, netTypesPortMappingToGenericPort(p)...)
genericList[i].Ports = append(genericList[i].Ports, netTypesPortMappingToGenericPortBinding(p)...)
}

genericList[i].SetRuntime(r)
Expand All @@ -320,12 +320,12 @@ func (r *PodmanRuntime) produceGenericContainerList(ctx context.Context,
return genericList, nil
}

func netTypesPortMappingToGenericPort(pm netTypes.PortMapping) []*types.GenericPort {
func netTypesPortMappingToGenericPortBinding(pm netTypes.PortMapping) []*types.GenericPortBinding {
// convert netTypes.PortMapping to types.GenericPort
// resolving the ranges into single port entries
result := make([]*types.GenericPort, pm.Range)
result := make([]*types.GenericPortBinding, pm.Range)
for offset := uint16(0); offset < pm.Range; offset++ {
result[offset] = &types.GenericPort{
result[offset] = &types.GenericPortBinding{
HostIP: pm.HostIP,
HostPort: int(pm.HostPort),
ContainerPort: int(pm.ContainerPort),
Expand Down

0 comments on commit 1e5fd39

Please sign in to comment.