Skip to content

feat: add EKS cluster and node group browser#183

Open
YoungJinJung wants to merge 1 commit intomainfrom
feature/166-eks-cluster-nodegroup-browser
Open

feat: add EKS cluster and node group browser#183
YoungJinJung wants to merge 1 commit intomainfrom
feature/166-eks-cluster-nodegroup-browser

Conversation

@YoungJinJung
Copy link
Copy Markdown
Contributor

Summary

  • add an EKS service entry with a cluster and managed node group browser
  • show cluster version, status, endpoint visibility, and ARN summary in the TUI
  • drill into managed node groups with scaling bounds and health issues

Testing

  • PATH=/opt/homebrew/bin:/Users/kuma/.codex/tmp/arg0/codex-arg0k9s3y2:/Users/kuma/.pyenv/plugins/pyenv-virtualenv/shims:/Users/kuma/.pyenv/shims:/Users/kuma/.gvm/bin:/Users/kuma/.antigravity/antigravity/bin:/opt/homebrew/opt/postgresql@13/bin:/opt/homebrew/opt/go@1.25/bin:/opt/homebrew/opt/libpq/bin:/Users/kuma/.local/bin:/Applications/Wireshark.app/Contents/MacOS:/Users/kuma/.krew/bin:/opt/homebrew/opt/mysql@5.7/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/kuma/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/Users/kuma/.tfenv/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/usr/local/go/bin:/Users/kuma/.cargo/bin:/opt/homebrew/opt/go@1.25/libexec/bin:/Applications/Codex.app/Contents/Resources make test
  • PATH=/opt/homebrew/bin:/Users/kuma/.codex/tmp/arg0/codex-arg0k9s3y2:/Users/kuma/.pyenv/plugins/pyenv-virtualenv/shims:/Users/kuma/.pyenv/shims:/Users/kuma/.gvm/bin:/Users/kuma/.antigravity/antigravity/bin:/opt/homebrew/opt/postgresql@13/bin:/opt/homebrew/opt/go@1.25/bin:/opt/homebrew/opt/libpq/bin:/Users/kuma/.local/bin:/Applications/Wireshark.app/Contents/MacOS:/Users/kuma/.krew/bin:/opt/homebrew/opt/mysql@5.7/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/kuma/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/Users/kuma/.tfenv/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/usr/local/go/bin:/Users/kuma/.cargo/bin:/opt/homebrew/opt/go@1.25/libexec/bin:/Applications/Codex.app/Contents/Resources make build

Closes #166

Copy link
Copy Markdown
Contributor

@amazon-q-developer amazon-q-developer Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This PR successfully adds EKS cluster and managed node group browsing capabilities to the TUI. The implementation includes comprehensive features for viewing cluster details, node group scaling configurations, and health status.

Critical Changes Required

Closure Variable Capture Issue: Both loadEKSClusters() and loadEKSNodeGroups() in internal/app/screen_eks.go capture variables outside their closure scope that should be captured inside. Move the cfg and cluster variable assignments inside the closure functions to prevent potential race conditions where the Model's state changes between closure creation and execution.

Strengths

  • Clean implementation following existing TUI patterns
  • Proper pagination handling for EKS API calls
  • Good test coverage with mock clients
  • Appropriate error handling throughout
  • Well-structured UI components with filtering and navigation

You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

}

func (m Model) loadEKSClusters() tea.Cmd {
cfg := m.cfg
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reassigning the closure variable inside the loop causes both loadEKSClusters() and loadEKSNodeGroups() to capture the same cfg reference. If the Model's cfg field changes between the creation of the closure and its execution, both functions will use the modified cfg value, potentially causing unexpected behavior or accessing incorrect AWS credentials.

Suggested change
cfg := m.cfg
return func() tea.Msg {
cfg := m.cfg
ctx, cancel := context.WithTimeout(context.Background(), eksAPITimeout)

Comment on lines +325 to +326
cfg := m.cfg
cluster := m.selectedEKSCluster
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reassigning the closure variable inside the loop causes both loadEKSClusters() and loadEKSNodeGroups() to capture the same cfg reference. If the Model's cfg field changes between the creation of the closure and its execution, both functions will use the modified cfg value, potentially causing unexpected behavior or accessing incorrect AWS credentials.

Suggested change
cfg := m.cfg
cluster := m.selectedEKSCluster
return func() tea.Msg {
cfg := m.cfg
cluster := m.selectedEKSCluster
if cluster == nil {
return errMsg{fmt.Errorf("no EKS cluster selected")}
}
ctx, cancel := context.WithTimeout(context.Background(), eksAPITimeout)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add EKS cluster and node group browser

2 participants