build: silently fail if git remote not found

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
pull/1568/head
CrazyMax 2 years ago
parent eacecf657c
commit 4789d2219c
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7

@ -78,9 +78,7 @@ func getGitAttributes(ctx context.Context, contextPath string, dockerfilePath st
}
}
if rurl, err := gitc.RemoteURL(); err != nil {
return res, errors.Wrapf(err, "failed to get git remote url")
} else if rurl != "" {
if rurl, err := gitc.RemoteURL(); err == nil && rurl != "" {
if setGitLabels {
res["label:"+specs.AnnotationSource] = rurl
}

Loading…
Cancel
Save