Skip to content

Commit

Permalink
Keep optionally a way to pull from the image list
Browse files Browse the repository at this point in the history
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
  • Loading branch information
mudler committed Sep 27, 2021
1 parent 99aaad0 commit 25b27ad
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,24 @@ func main() {
if os.Getenv("DOWNLOAD_ALL") == "true" {
fmt.Println("Downloading all available metadata files on the remote repository")
var err error
for _, t := range currentPackages.Packages {
img := fmt.Sprintf("%s:%s.metadata.yaml", finalRepo, t.ImageTag())
fmt.Println("Downloading", img)
err = multierror.Append(err, downloadImage(img, "build"))
if os.Getenv("DOWNLOAD_FROM_LIST") == "true" {
tags, err := imageTags(finalRepo)
checkErr(err)
for _, t := range tags {
if strings.HasSuffix(t, ".metadata.yaml") {
img := fmt.Sprintf("%s:%s", finalRepo, t)
fmt.Println("Downloading", img)
err = multierror.Append(err, downloadImage(img, "build"))
}
}
} else {
for _, t := range currentPackages.Packages {
img := fmt.Sprintf("%s:%s.metadata.yaml", finalRepo, t.ImageTag())
fmt.Println("Downloading", img)
err = multierror.Append(err, downloadImage(img, "build"))
}
}

if err != nil {
// We might not want to always be strict, but we might relax because
// there might be occasions when we remove images from registries due
Expand Down

0 comments on commit 25b27ad

Please sign in to comment.