-
Notifications
You must be signed in to change notification settings - Fork 135
Track preserved failed machines in MCS and MCD status #1092
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
Open
thiyyakat
wants to merge
12
commits into
gardener:master
Choose a base branch
from
thiyyakat:mcd-preservation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
89d0a62
Add preserved failed replicas tracking to machine types and status
thiyyakat 7377366
re-use variable isMachinePreserved and remove preserve=when-failed wh…
thiyyakat 44ac390
Add test for preservedFailedReplica count
thiyyakat bd0a1e1
Address review comments by @aaronfern and @takoverflow.
thiyyakat 36bda7e
Add files generated by `make generate`
thiyyakat a47f9a5
Address review comments
thiyyakat aaa037c
Regenerate files with GOTOOLCHAIN=1.23.0
thiyyakat 2dfdbdc
Add DWD warning for AutoPreserveFailedMax and race condition warning …
thiyyakat ebb4ef2
Address review comment by @r4mek
thiyyakat 0dd3ecf
Handle node not found errors differently to prevent excessive logging…
thiyyakat e44b512
Fix bugs which could have led to conflict errors
thiyyakat 2b3c146
Remove warning about DWD and high AutoPreserveFailedMachineMax values
thiyyakat 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
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
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
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 |
|---|---|---|
|
|
@@ -25,14 +25,15 @@ package controller | |
| import ( | ||
| "context" | ||
| "fmt" | ||
| "github.com/gardener/machine-controller-manager/pkg/util/nodeops" | ||
| "maps" | ||
| "reflect" | ||
| "sort" | ||
| "strconv" | ||
| "strings" | ||
| "time" | ||
|
|
||
| "github.com/gardener/machine-controller-manager/pkg/util/nodeops" | ||
|
|
||
| v1 "k8s.io/api/core/v1" | ||
| apiequality "k8s.io/apimachinery/pkg/api/equality" | ||
| "k8s.io/apimachinery/pkg/api/meta" | ||
|
|
@@ -1041,6 +1042,17 @@ func GetAvailableReplicaCountForMachineSets(MachineSets []*v1alpha1.MachineSet) | |
| return totalAvailableReplicas | ||
| } | ||
|
|
||
| // GetPreservedFailedReplicaCountForMachineSets returns the number of available machines corresponding to the given machine sets. | ||
|
Member
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. Docstring needs to be corrected |
||
| func GetPreservedFailedReplicaCountForMachineSets(MachineSets []*v1alpha1.MachineSet) int32 { | ||
| totalPreservedFailedReplicas := int32(0) | ||
| for _, is := range MachineSets { | ||
| if is != nil { | ||
| totalPreservedFailedReplicas += is.Status.PreservedFailedReplicas | ||
| } | ||
| } | ||
| return totalPreservedFailedReplicas | ||
| } | ||
|
|
||
| // IsRollingUpdate returns true if the strategy type is a rolling update. | ||
| func IsRollingUpdate(deployment *v1alpha1.MachineDeployment) bool { | ||
| return deployment.Spec.Strategy.Type == v1alpha1.RollingUpdateMachineDeploymentStrategyType | ||
|
|
||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.