Skip to content

Add EKS support (5 resources) + navigation fixes#128

Merged
yimsk merged 18 commits into
developfrom
feature/eks-support
Jan 10, 2026
Merged

Add EKS support (5 resources) + navigation fixes#128
yimsk merged 18 commits into
developfrom
feature/eks-support

Conversation

@yimsk
Copy link
Copy Markdown
Contributor

@yimsk yimsk commented Jan 10, 2026

Summary

  • 5 new EKS resources: clusters, node-groups, fargate-profiles, addons, access-entries
  • 26 cross-resource navigation links
  • Global key conflict fixes (c→p, a→o/g/t, m→s)
  • Navigation filter support for 9 resources
  • Test infrastructure: CloudFormation stack + automation

Changes

New Resources (5)

  • EKS clusters (parent)
  • EKS node-groups (child)
  • EKS fargate-profiles (child)
  • EKS addons (child)
  • EKS access-entries (child)

Navigation Enhancements

  • 26 EKS navigation links (cluster → children, children → IAM/EC2/VPC)
  • Filter support: ASG, LaunchTemplate, KeyPair, IAM roles/users, RDS, StepFunctions, VPC TGW
  • Global key conflicts resolved

Bug Fixes

  • IsNotFound() lowercase matching
  • Resource unwrapping for DiffView/ActionMenu
  • Filter clear reload pattern
  • DiffView AI chat metadata preservation
  • Deprecated strings.Title fix

Test Infrastructure

  • CloudFormation EKS test stack
  • Automated deploy/cleanup scripts (task eks-test-up/down)

Stats

  • 47 files changed (+3254/-36)
  • 169 resources total
  • 14 commits

Code Review

✅ CLAUDE.md compliant
✅ No bugs found
✅ All historical fixes applied
✅ Ready to merge

Details: Snap fe645947-2c96-7506-a8e8-058c08932d3e

yimsk added 18 commits January 6, 2026 22:13
docs: simplify homebrew install command
feat: configurable startup view with navigation improvements
CloudWatch Logs filter (v0.9.1)
v0.10: AI Chat with Bedrock, ECS task-definitions, resource pagination
…, addons, access-entries)

- clusters: standalone, 11 detail sections
- node-groups: sub-resource, scaling/health info
- fargate-profiles: sub-resource, selectors/subnets
- addons: sub-resource, versions/config
- access-entries: sub-resource, IAM→K8s mapping
- registry: add EKS to Compute category
- SDK: aws-sdk-go-v2/service/eks v1.76.3

Total: 20 files, ~1807 lines
- node-groups: Return all instance types (not just first)
- registry: Add EKS default resource (clusters)
- EKS: Full navigation for all 5 resources (clusters, node-groups, fargate-profiles, addons, access-entries)
  - Parent cluster (p), IAM roles (r), CloudWatch logs (l), VPC/SG (v/s), ASG/LaunchTemplate (g/t)
- Add EKS test fixtures: CloudFormation template + deploy/cleanup scripts for integration testing
- Add LocalStack tasks for EKS demo data
- Fix global key conflicts: c→p (Clear filter), a→o/g/t (Actions menu), m→s (Mark resource)
  - Affected: ECS, RDS, autoscaling, stepfunctions, transit-gateways
Add RoleName/UserName filter support to enable navigation from other resources (EKS, EC2, Lambda, ECS, etc).

Changes:
- roles: Check RoleName filter in ListPage(), direct Get() lookup
- users: Check UserName filter in List(), direct Get() lookup
- Return empty list if not found (not error, for filter behavior)

Fixes: Navigation failure when pressing 'r' on EKS clusters/nodes/fargate/addons
Enhance cleanup.sh reliability w/ auto-retry & auth fix:
- Auto-retry on DELETE_FAILED (max 2 attempts)
- Fix auth mode to API before deletion (resolves deletion blocks)
- CI_MODE env var for non-interactive cleanup
- Update README: document retry behavior, env vars (CI_MODE, MAX_RETRY)

Production-grade improvements for CI/CD integration.
- EKS clusters: Add ClusterName filter for child->parent nav
- IAM roles: Move filter check List()->consistent w/ users/clusters
- Resource browser: Reload on 'c' (fix filtered DAO cache)
Navigation broken - Navigations() returned empty array due to failed type assertion.

Root cause: handleNavigation() used wrapped resource from contextForResource(),
but Navigations() methods expect unwrapped concrete types (e.g. *ClusterResource).

Fix: Use dao.UnwrapResource() like getNavigationShortcuts() does.

Test: All resource navigation keys (n/f/a/e/r/l/v/s/g/t/o/p) work.
Enables filtered navigation from EKS node-groups. DAOs now check GetFilterFromContext for AutoScalingGroupName, LaunchTemplateId, KeyName filters, returning single resource instead of full list.
79 DAOs use fmt.Errorf('resource not found: %s', id) (lowercase).
IsNotFound() only checked AWS SDK codes + 'NotFound' (capital N).
Filter navigation (ASG/EC2/IAM/EKS) relies on IsNotFound() -> failed on non-existent resources.

Add 'not found' to hasErrorCode() -> 1 line fix, no user-facing change.
- Update README.md: 163→169 resources, add EKS
- Regenerate imports_custom.go via task gen-imports
- Update resource count: 163→169
- Add EKS to Containers & ML section (5 resources)
- Add Task Definitions to ECS
- Add eks alias
Problem: commit 2780b20 broke AI chat in diff mode by unwrapping
resources before passing to DiffView, losing region/profile info.

Solution: DiffView now stores both wrapped (for metadata) and
unwrapped (for rendering) resources. buildAIContext() gets correct
region/profile from wrapped resources via buildResourceRef().

Files: internal/view/{diff_view,resource_browser_input}.go
@claude
Copy link
Copy Markdown

claude Bot commented Jan 10, 2026

PR Review: Add EKS support (5 resources) + navigation fixes

Summary

This PR adds comprehensive EKS support with 5 new resources (clusters, node-groups, fargate-profiles, addons, access-entries) and implements 26 cross-resource navigation links. The implementation is well-structured and follows the project's established patterns.

✅ Code Quality & Best Practices

Excellent

  1. Consistent Architecture: All 5 EKS resources follow the established DAO/Renderer pattern with proper registration
  2. Error Handling: Proper use of apperrors.Wrap/Wrapf throughout with informative context
  3. Navigation Pattern: Well-implemented parent-child relationships with proper filter handling
  4. Code Reuse: Good use of appaws.Paginate helper for pagination
  5. Type Safety: Proper type assertions with ok checks in all renderer methods
  6. Documentation: CloudFormation test fixtures include comprehensive README

Good Practices Observed

  • Proper use of dao.GetFilterFromContext for filtered navigation
  • Consistent error handling with IsNotFound checks returning empty lists instead of errors
  • Sub-resources properly registered in registry.go subResourceSet (lines 651-654)
  • Generated constants files with proper comments
  • Proper resource unwrapping in DiffView and ActionMenu (fixes in diff_view.go:50-51 and resource_browser_nav.go)

🐛 Potential Issues

1. IsNotFound() Case Sensitivity Fix

The fix in internal/errors/errors.go:93 adds lowercase "not found" matching. This is a good defensive addition, but:

  • Concern: String matching on error messages is fragile and locale-dependent
  • Recommendation: Consider logging when this fallback is triggered to identify APIs that don't use proper error codes

2. List() Performance Considerations

Multiple DAO implementations call DescribeCluster/DescribeNodegroup in loops:

EKS Clusters DAO (custom/eks/clusters/dao.go:69-82):

for _, name := range clusterNames {
    output, err := d.client.DescribeCluster(ctx, &eks.DescribeClusterInput{...})
    // ...
}

Impact:

  • For accounts with many EKS resources, this creates N+1 API calls
  • AWS SDK doesn't offer batch describe operations for EKS
  • This pattern is unavoidable given AWS API design

Recommendation: Consider adding comments explaining why individual calls are necessary, and potentially add rate limiting if needed in future.

3. Global Key Conflict Resolution

Key binding changes throughout various renderers:

  • c → p for "Cluster" (ECS services/tasks)
  • a → o/g/t for activities/addons
  • m → s for mappings

Good: These resolve real conflicts
Concern: May affect muscle memory for existing users
Recommendation: Document these key binding changes in release notes

🔒 Security

No Issues Found ✅

  • No credential handling in code
  • Proper use of IAM roles via ARN references
  • CloudFormation templates use least-privilege IAM policies
  • No hardcoded secrets or sensitive data

⚡ Performance

Minor Concerns

  1. N+1 Queries: As mentioned above, List() methods make multiple describe calls
  2. Navigation Filter Performance: Filter-based navigation uses List() then filters client-side in some resources
    • Example: custom/autoscaling/groups/dao.go:36-46 calls Get() when filter is present (good optimization)
    • Other resources like launch templates do the same (good)

Optimizations Applied ✅

  • Filter-aware DAOs short-circuit to direct lookups where possible
  • Proper use of pagination to avoid loading all data at once

🧪 Test Coverage

Strengths

  1. Excellent Test Infrastructure: CloudFormation-based integration testing

    • Comprehensive eks-test-stack.yaml with VPC, subnets, NAT gateway, and all EKS resources
    • Automated deploy/cleanup scripts with proper error handling
    • Task integration (eks-test-up, eks-test-down) for easy testing
  2. Real AWS Environment: Tests against actual AWS APIs, not mocks

Gaps

  1. No Unit Tests: No Go unit tests for the new EKS resources
  2. No CI Integration: CloudFormation tests are manual (though this is expensive to run in CI)
  3. Error Path Coverage: No tests for error handling (not found, access denied, etc.)

Recommendation: Consider adding unit tests for:

  • DAO filter logic
  • Renderer navigation generation
  • Error classification

📝 Documentation

Excellent

  1. README Updates: Resource count updated (163→169) ✅
  2. CloudFormation Documentation: Comprehensive README in test-fixtures
  3. Code Comments: Well-commented complex logic

Missing

  1. Migration Guide: No documentation for changed key bindings
  2. Service Documentation: docs/services.md updated but could include EKS-specific navigation patterns

🔍 Specific Code Review

1. Taskfile.yml Changes (Lines 66-90)

Issue: Removed YAML anchor syntax for env vars

# Before:
env: &localstack-env
  AWS_ENDPOINT_URL: http://localhost:4566

# After: Inline duplication

Impact: Minor - increases duplication but improves readability
Verdict: Acceptable trade-off ✅

2. DiffView Resource Unwrapping (diff_view.go:44-56)

Excellent Fix ✅: Properly unwraps ProfiledResource/RegionalResource while preserving metadata

leftUnwrap:   dao.UnwrapResource(left), // unwrap for rendering

This fixes AI chat metadata preservation issue mentioned in PR description.

3. Navigation Implementation

Example from addons/render.go:170-192:

navs = append(navs, render.Navigation{
    Key:         "p",
    Label:       "Cluster",
    Service:     "eks",
    Resource:    "clusters",
    FilterField: "ClusterName",
    FilterValue: clusterName,
})

Perfect Implementation ✅: Follows the navigation pattern from docs/adding-resources.md

4. Registry Updates

All sub-resources properly added to subResourceSet in registry.go:651-654:

"eks/node-groups":      {},
"eks/fargate-profiles": {},
"eks/addons":           {},
"eks/access-entries":   {},

Correct

📊 Statistics

  • Files Changed: 47
  • Additions: +3254 lines
  • Deletions: -36 lines
  • New Resources: 5 (169 total)
  • Navigation Links: 26
  • Test Infrastructure: CloudFormation stack + automation scripts

🎯 Final Verdict

Strengths

  1. ✅ Comprehensive implementation following established patterns
  2. ✅ Excellent test infrastructure
  3. ✅ Proper error handling
  4. ✅ Well-documented code
  5. ✅ Fixed multiple existing bugs (DiffView unwrapping, string matching, filter patterns)

Minor Improvements Suggested

  1. Consider documenting key binding changes in CHANGELOG or release notes
  2. Add unit tests for filter logic (optional, not blocking)
  3. Consider logging when lowercase error matching is triggered

Recommended Actions

  • Approve and Merge: Code quality is excellent and follows project conventions
  • Document key binding changes for users
  • Consider adding unit tests in future PRs

Overall Rating: Excellent ⭐⭐⭐⭐⭐

The code is production-ready. The implementation is clean, well-tested (with CloudFormation fixtures), and properly integrated. The bug fixes for DiffView and navigation filtering are valuable improvements beyond the EKS feature addition.

Status: Ready to merge ✅


Review conducted by Claude Code - Automated PR Review

@yimsk yimsk merged commit b02abb8 into develop Jan 10, 2026
5 checks passed
@yimsk yimsk deleted the feature/eks-support branch January 10, 2026 07:13
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.

1 participant