Merge pull request #163 from filmil/remove-special-codepath

git-sync: removes special exit on first error
This commit is contained in:
Kubernetes Prow Robot 2019-04-02 22:05:42 -07:00 committed by GitHub
commit 5482a3ed24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -289,7 +289,8 @@ func main() {
if changed, err := syncRepo(ctx, *flRepo, *flBranch, *flRev, *flDepth, *flRoot, *flDest); err != nil {
syncDuration.WithLabelValues("error").Observe(time.Now().Sub(start).Seconds())
syncCount.WithLabelValues("error").Inc()
if initialSync || (*flMaxSyncFailures != -1 && failCount >= *flMaxSyncFailures) {
if *flMaxSyncFailures != -1 && failCount >= *flMaxSyncFailures {
// Exit after too many retries, maybe the error is not recoverable.
log.Error(err, "failed to sync repo, aborting")
os.Exit(1)
}