mirror of
https://github.com/containers/podman.git
synced 2025-07-04 10:10:32 +08:00
Use sprintf to generate port numbers while committing
Casting integers to strings is definitely not correct, so let the standard library handle matters. Fixes #2066 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
@ -2,6 +2,7 @@ package libpod
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/containers/buildah"
|
||||
@ -101,7 +102,7 @@ func (c *Container) Commit(ctx context.Context, destImage string, options Contai
|
||||
}
|
||||
// Expose ports
|
||||
for _, p := range c.config.PortMappings {
|
||||
importBuilder.SetPort(string(p.ContainerPort))
|
||||
importBuilder.SetPort(fmt.Sprintf("%d", p.ContainerPort))
|
||||
}
|
||||
// Labels
|
||||
for k, v := range c.Labels() {
|
||||
|
Reference in New Issue
Block a user