mirror of
https://github.com/docker/compose.git
synced 2025-07-27 07:34:10 +02:00
fix parsing of repository:tag
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
0368f19030
commit
05e987dd0a
@ -22,6 +22,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/distribution/distribution/v3/reference"
|
||||||
moby "github.com/docker/docker/api/types"
|
moby "github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/api/types/filters"
|
"github.com/docker/docker/api/types/filters"
|
||||||
"github.com/docker/docker/errdefs"
|
"github.com/docker/docker/errdefs"
|
||||||
@ -94,10 +95,13 @@ func (s *composeService) getImages(ctx context.Context, images []string) (map[st
|
|||||||
tag := ""
|
tag := ""
|
||||||
repository := ""
|
repository := ""
|
||||||
if len(inspect.RepoTags) > 0 {
|
if len(inspect.RepoTags) > 0 {
|
||||||
repotag := strings.Split(inspect.RepoTags[0], ":")
|
ref, err := reference.ParseDockerRef(inspect.RepoTags[0])
|
||||||
repository = repotag[0]
|
if err != nil {
|
||||||
if len(repotag) > 1 {
|
return err
|
||||||
tag = repotag[1]
|
}
|
||||||
|
repository = reference.FamiliarName(ref)
|
||||||
|
if tagged, ok := ref.(reference.Tagged); ok {
|
||||||
|
tag = tagged.Tag()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
l.Lock()
|
l.Lock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user