Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: Iterate on all available tags to check if tag exist #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions server/builds.go
Expand Up @@ -48,14 +48,16 @@ func (b *Builds) waitForImage(ctx context.Context, s *Server, reg *registry.Regi
case <-ctx.Done():
return pr, errors.New("timed out waiting for image to publish")
case <-time.After(30 * time.Second):
_, err := reg.ManifestDigest(imageToCheck, desiredTag)
availableTags, err := reg.Tags(imageToCheck)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering if there is a test. if it's not it's ok.

if err != nil && !strings.Contains(err.Error(), "status=404") {
return pr, errors.Wrap(err, "unable to fetch tag from docker registry")
return pr, errors.Wrap(err, "unable to fetch tags from docker registry")
}

if err == nil {
logger.Info("Docker tag found!")
return pr, nil
logger.Info("We found", len(availableTags), "tags available")
for _, tag := range availableTags {
if tag == desiredTag {
logger.Info("Docker tag found!")
return pr, nil
}
}

logger.Debug("Docker tag for the build not found. Waiting...")
Expand Down