Merge pull request #2067 from mheon/fix_garbage_ports

Use sprintf to generate port numbers while committing
This commit is contained in:
OpenShift Merge Robot 2019-01-02 07:55:24 -08:00 committed by GitHub
commit e796f522f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package libpod
import ( import (
"context" "context"
"fmt"
"strings" "strings"
"github.com/containers/buildah" "github.com/containers/buildah"
@ -101,7 +102,7 @@ func (c *Container) Commit(ctx context.Context, destImage string, options Contai
} }
// Expose ports // Expose ports
for _, p := range c.config.PortMappings { for _, p := range c.config.PortMappings {
importBuilder.SetPort(string(p.ContainerPort)) importBuilder.SetPort(fmt.Sprintf("%d", p.ContainerPort))
} }
// Labels // Labels
for k, v := range c.Labels() { for k, v := range c.Labels() {