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

Fix broken curl in multiarch build + fix retry logic break #44

Merged
merged 4 commits into from Jul 7, 2020
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .circleci/config.yml
Expand Up @@ -132,6 +132,7 @@ jobs:
name: Push multiarch Docker image
command: |
apk add -U make bash curl
apk upgrade
make manifest-push DOCKER_IMAGE_TAG=${CIRCLE_TAG:-latest}

workflows:
Expand Down
14 changes: 12 additions & 2 deletions configmap-reload.go
Expand Up @@ -115,8 +115,11 @@ func main() {
req.SetBasicAuth(userInfo.Username(), password)
}
}

successfulReloadWebhook := false

for retries := *webhookRetries; retries != 0; retries-- {
log.Printf("performing webhook request (%d/%d)", retries, *webhookRetries+1)
log.Printf("performing webhook request (%d/%d)", retries, *webhookRetries)
resp, err := http.DefaultClient.Do(req)
if err != nil {
setFailureMetrics(h.String(), "client_request_do")
Expand All @@ -132,9 +135,16 @@ func main() {
time.Sleep(time.Second * 10)
continue
}

setSuccessMetrict(h.String(), begun)
log.Println("successfully triggered reload")
return
successfulReloadWebhook = true
break
}

if !successfulReloadWebhook {
setFailureMetrics(h.String(), "retries_exhausted")
log.Println("error:", "Webhook reload retries exhausted")
}
}
case err := <-watcher.Errors:
Expand Down