-
Notifications
You must be signed in to change notification settings - Fork 288
CORENET-6572: avoid reporting Progressing during node reboots #2936
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,7 +96,8 @@ func (status *StatusManager) SetFromPods() { | |
| } else if ds.Status.UpdatedNumberScheduled < ds.Status.DesiredNumberScheduled { | ||
| progressing = append(progressing, fmt.Sprintf("DaemonSet %q update is rolling out (%d out of %d updated)", dsName.String(), ds.Status.UpdatedNumberScheduled, ds.Status.DesiredNumberScheduled)) | ||
| dsProgressing = true | ||
| } else if ds.Status.NumberUnavailable > 0 { | ||
| } else if ds.Status.NumberUnavailable > 0 && (ds.Status.DesiredNumberScheduled == 0 || ds.Generation > ds.Status.ObservedGeneration) { | ||
| // Report Progressing only during initial deployment (DesiredNumberScheduled not set) or active rollout (spec changed) | ||
| progressing = append(progressing, fmt.Sprintf("DaemonSet %q is not available (awaiting %d nodes)", dsName.String(), ds.Status.NumberUnavailable)) | ||
| dsProgressing = true | ||
| // Check for any pods in CrashLoopBackOff state and mark the operator as degraded if so. | ||
|
|
@@ -153,8 +154,11 @@ func (status *StatusManager) SetFromPods() { | |
| progressing = append(progressing, fmt.Sprintf("StatefulSet %q update is rolling out (%d out of %d updated)", ssName.String(), ss.Status.UpdatedReplicas, ss.Status.Replicas)) | ||
| ssProgressing = true | ||
| } else if ss.Status.ReadyReplicas > 0 && ss.Status.ReadyReplicas < ss.Status.Replicas { | ||
| progressing = append(progressing, fmt.Sprintf("StatefulSet %q is not available (awaiting %d nodes)", ssName.String(), (ss.Status.Replicas-ss.Status.ReadyReplicas))) | ||
| ssProgressing = true | ||
| if ss.Generation == 0 || ss.Status.ObservedGeneration < ss.Generation { | ||
| // Report Progressing during initial deployment or active rollout (spec changed) | ||
| progressing = append(progressing, fmt.Sprintf("StatefulSet %q is not available (awaiting %d nodes)", ssName.String(), (ss.Status.Replicas-ss.Status.ReadyReplicas))) | ||
| ssProgressing = true | ||
| } | ||
| // Check for any pods in CrashLoopBackOff state and mark the operator as degraded if so. | ||
| if !isNonCritical(ss) { | ||
| hung = append(hung, status.CheckCrashLoopBackOffPods(ssName, ss.Spec.Selector.MatchLabels, "StatefulSet")...) | ||
|
|
@@ -208,8 +212,11 @@ func (status *StatusManager) SetFromPods() { | |
| progressing = append(progressing, fmt.Sprintf("Deployment %q update is rolling out (%d out of %d updated)", depName.String(), dep.Status.UpdatedReplicas, dep.Status.Replicas)) | ||
| depProgressing = true | ||
| } else if dep.Status.UnavailableReplicas > 0 { | ||
| progressing = append(progressing, fmt.Sprintf("Deployment %q is not available (awaiting %d nodes)", depName.String(), dep.Status.UnavailableReplicas)) | ||
| depProgressing = true | ||
| if dep.Generation == 0 || dep.Status.ObservedGeneration < dep.Generation { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. likewise |
||
| // Report Progressing during initial deployment or active rollout (spec changed) | ||
| progressing = append(progressing, fmt.Sprintf("Deployment %q is not available (awaiting %d nodes)", depName.String(), dep.Status.UnavailableReplicas)) | ||
| depProgressing = true | ||
| } | ||
| // Check for any pods in CrashLoopBackOff state and mark the operator as degraded if so. | ||
| if !isNonCritical(dep) { | ||
| hung = append(hung, status.CheckCrashLoopBackOffPods(depName, dep.Spec.Selector.MatchLabels, "Deployment")...) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ss.Generation == 0is wrong... I assume this is supposed to be the equivalent of theds.Status.NumberUnavailablecheck aboveThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danwinship , I think I ended up with this
== 0stuff mostly to make the tests pass. I took a deeper look at this with codex and we came up with this, which should be a little more comprehensive. It's also trying to solve the small window when the controller has observed a new generation but before the rollout is actually fully healthy. That changeset is a little more than this, but hopefully addresses it more properly.