mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 18:05:42 +03:00
small review feedback fixes
This commit is contained in:
committed by
Preetha Appan
parent
c3b9a9c94e
commit
1050b89ac3
@@ -345,11 +345,13 @@ func (w *deploymentWatcher) StopWatch() {
|
||||
// watch is the long running watcher that watches for both allocation and
|
||||
// deployment changes. Its function is to create evaluations to trigger the
|
||||
// scheduler when more progress can be made, to fail the deployment if it has
|
||||
// failed and potentially rolling back the job.
|
||||
// failed and potentially rolling back the job. Progress can be made when an
|
||||
// allocation transistions to healthy, so we create an eval.
|
||||
func (w *deploymentWatcher) watch() {
|
||||
// Get the deadline. This is likely a zero time to begin with but we need to
|
||||
// handle the case that the deployment has already progressed and we are now
|
||||
// just starting to watch it.
|
||||
// just starting to watch it. This must likely would occur if there was a
|
||||
// leader transistion and we are now starting our watcher.
|
||||
currentDeadline := getDeploymentProgressCutoff(w.getDeployment())
|
||||
var deadlineTimer *time.Timer
|
||||
if currentDeadline.IsZero() {
|
||||
@@ -373,7 +375,7 @@ FAIL:
|
||||
return
|
||||
case <-deadlineTimer.C:
|
||||
// We have hit the progress deadline so fail the deployment. We need
|
||||
// to determine whether we should rollback the job by inspecting
|
||||
// to determine whether we should roll back the job by inspecting
|
||||
// which allocs as part of the deployment are healthy and which
|
||||
// aren't.
|
||||
var err error
|
||||
|
||||
@@ -2516,7 +2516,7 @@ type UpdateStrategy struct {
|
||||
HealthyDeadline time.Duration
|
||||
|
||||
// ProgressDeadline is the time in which an allocation as part of the
|
||||
// deployment must transistion to healthy. If no allocation becomes healthy
|
||||
// deployment must transition to healthy. If no allocation becomes healthy
|
||||
// after the deadline, the deployment is marked as failed. If the deadline
|
||||
// is zero, the first failure causes the deployment to fail.
|
||||
ProgressDeadline time.Duration
|
||||
@@ -5469,11 +5469,11 @@ type DeploymentState struct {
|
||||
// reverted on failure
|
||||
AutoRevert bool
|
||||
|
||||
// ProgressDeadline is the deadline by which an allocation must transistion
|
||||
// ProgressDeadline is the deadline by which an allocation must transition
|
||||
// to healthy before the deployment is considered failed.
|
||||
ProgressDeadline time.Duration
|
||||
|
||||
// RequireProgressBy is the time by which an allocation must transistion
|
||||
// RequireProgressBy is the time by which an allocation must transition
|
||||
// to healthy before the deployment is considered failed.
|
||||
RequireProgressBy time.Time
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ func (a *allocReconciler) Compute() *reconcileResults {
|
||||
// XXX Fix
|
||||
// XXX An idea for not replacing failed allocs that are part of
|
||||
// deployment that will fail immediately is to only replace them if
|
||||
// their desired transistion has a replace bool set by the deployment
|
||||
// their desired transition has a replace bool set by the deployment
|
||||
// watcher.
|
||||
|
||||
// Detect if any allocs associated with this deploy have failed
|
||||
|
||||
Reference in New Issue
Block a user