fix: detect ROLLBACK_COMPLETE nodegroup stacks during create#8713
Open
costela wants to merge 1 commit intoeksctl-io:mainfrom
Open
fix: detect ROLLBACK_COMPLETE nodegroup stacks during create#8713costela wants to merge 1 commit intoeksctl-io:mainfrom
costela wants to merge 1 commit intoeksctl-io:mainfrom
Conversation
When `eksctl create nodegroup` encounters an existing CloudFormation stack in ROLLBACK_COMPLETE state for a nodegroup in the user's config, it now fails fast with an actionable error instead of silently treating the broken stack as a healthy existing nodegroup. Also fixes a misleading log message that claimed "all nodegroups have up-to-date cloudformation templates" when the check only validates shared security group compatibility, and removes ROLLBACK_COMPLETE from the set of non-transitional "ready" stack statuses. Fixes eksctl-io#8712 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
eksctl create nodegroupnow fails fast with an actionable error when it encounters a nodegroup stack inROLLBACK_COMPLETEstate that matches a nodegroup in the user's config, instead of silently skipping it and exiting 0"all nodegroups have up-to-date cloudformation templates"log message to accurately describe what is checked (shared security group compatibility)ROLLBACK_COMPLETEfromnonTransitionalReadyStackStatuses, which incorrectly grouped failed-create stacks with healthy terminal states likeCREATE_COMPLETEFixes #8712
Related: #4006 (same symptom, closed by stale-bot without a fix)
Root cause
Two bugs combined to produce the silent failure:
The create-nodegroup filter treated ROLLBACK_COMPLETE stacks as healthy existing nodegroups.
NodeGroupFilter.SetOnlyLocalcallsloadLocalAndRemoteNodegroups, which lists all nodegroup stacks and marks them as "remote" (i.e. already exists, skip creation).ListNodeGroupStacksonly filters outDELETE_COMPLETE/DELETE_FAILED, soROLLBACK_COMPLETEstacks pass through — causing the nodegroup to be silently excluded from the create plan.The post-create compatibility check used a misleading log message.
ValidateExistingNodeGroupsForCompatibilityonly checks shared security group CFN outputs viaisNodeGroupCompatible, but logged"all nodegroups have up-to-date cloudformation templates"— reading like a general health assertion. Its stack filterStackStatusIsNotTransitionalalso includedROLLBACK_COMPLETEin the "ready" set, so broken stacks passed the check.Changes
pkg/ctl/cmdutils/filter/nodegroup_filter.goloadLocalAndRemoteNodegroups(gated onf.onlyLocalso only the create path is affected); return actionable error witheksctl delete nodegrouphintpkg/eks/nodegroup_service.go"all nodegroups have compatible shared security group configuration"pkg/cfn/manager/api.goStackStatusRollbackCompletefromnonTransitionalReadyStackStatuses(keepUPDATE_ROLLBACK_COMPLETEwhich is genuinely healthy)pkg/ctl/cmdutils/filter/nodegroup_filter_test.goTest plan
go test -tags=release ./pkg/ctl/cmdutils/filter/... -ginkgo.focus "ROLLBACK_COMPLETE"go test -tags=release ./pkg/ctl/cmdutils/filter/... ./pkg/eks/... ./pkg/cfn/manager/...golangci-lint runreports 0 issues on modified packagesgo build -tags=release ./...compiles cleanlyeksctl create nodegroup— should now fail fast with the actionable error🤖 Generated with Claude Code