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

levant/deploy: skip health checks for task groups without canaries #83

Merged
merged 1 commit into from
Jan 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions levant/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,12 @@ func (c *nomadClient) checkCanaryDeploymentHealth(depID string) (healthy bool) {
// Itertate each task in the deployment to determine is health status. If an
// unhealthy task is found, incrament the unhealthy counter.
for taskName, taskInfo := range dep.TaskGroups {
// skip any task groups which are not configured for canary deployments
if taskInfo.DesiredCanaries == 0 {
logging.Debug("levant/deploy: task %s has no desired canaries, skipping health checks in deployment %s", taskName, depID)
continue
}

if taskInfo.DesiredCanaries != taskInfo.HealthyAllocs {
logging.Error("levant/deploy: task %s has unhealthy allocations in deployment %s", taskName, depID)
unhealthy++
Expand Down