Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Commit

Permalink
Handle exports w/ multiple tags on same image
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilder committed Aug 18, 2014
1 parent 959bc3c commit 914bea8
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,26 @@ func main() {
fatal(err)
}

if len(export.Repositories) > 0 {
fatal("This image is a full repository export w/ multiple images in it. " +
"You need to generate the export from a specific image ID or tag.")
// Export may have multiple branches with the same parent.
// We can't handle that currently so abort.
for _, v := range export.Repositories {
commits := map[string]string{}
for tag, commit := range *v {
commits[commit] = tag
}
if len(commits) > 1 {
fatal("This image is a full repository export w/ multiple images in it. " +
"You need to generate the export from a specific image ID or tag.")
}

}

start := export.FirstFrom()
// Can't find a FROM, default to root
if start == nil {
start = export.Root()
}

if from != "" {

if from == "root" {
Expand Down

0 comments on commit 914bea8

Please sign in to comment.