Skip draining managed nodegroups when deleting cluster #7515
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.
Description
As pointed out in #4205, the code intended to only drain unmanaged nodegroups since EKS should take care of managed nodegroups. However,
cmdutils.ToKubeNodeGroups
function has been populating theDrainInput
with both unmanaged and managed nodegroups. This causes an inconsistency where when usingeksctl delete cluster --config-file
with a config that specify the managed nodegroup config, that managed nodegroup get drained; buteksctl delete cluster --name
deleting the same cluster will skip draining the same managed nodegroup, because https://github.com/yuxiang-zhang/eksctl/blob/1d9cd7dc8370716d711e45bf17e2967434eb88f4/pkg/actions/cluster/delete.go#L174-L179 only populates the unmanaged nodegroups.Regardless of using
--config-file
, the behaviour for deleting a cluster should be consistent: either drain managed nodegroups, or skip draining managed nodegroups. This change sticks with the original intent from #4205, that is to skip draining managed nodegroups.Checklist
README.md
, or theuserdocs
directory)area/nodegroup
) and kind (e.g.kind/improvement
)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯