Skip to content

Commit

Permalink
trim slashes in cont name
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Jun 15, 2021
1 parent 0bde6cf commit 8256a24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions runtime/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"io/ioutil"
"path"
"strconv"
"strings"
"time"

dockerTypes "github.com/docker/docker/api/types"
Expand Down Expand Up @@ -480,12 +481,12 @@ func (c *DockerRuntime) DeleteContainer(ctx context.Context, container *types.Ge
force = true
}
}
log.Debugf("Removing container: %s", container.Names[0])
log.Debugf("Removing container: %s", strings.TrimLeft(container.Names[0], "/"))
err = c.Client.ContainerRemove(ctx, container.ID, dockerTypes.ContainerRemoveOptions{Force: force})
if err != nil {
return err
}
log.Infof("Removed container: %s", container.Names[0])
log.Infof("Removed container: %s", strings.TrimLeft(container.Names[0], "/"))
return nil
}

Expand Down

0 comments on commit 8256a24

Please sign in to comment.