feat(prerequisites): add --type k3d|eks|gke flag to check/install - #288
Conversation
The prerequisites command only covered the local k3d toolset (Docker, k3d, helm), while the terraform/AWS/gcloud requirements for cloud clusters were checked only inside 'cluster create'. Expose EKS/GKE sets through the shared prerequisites framework and let check/install target them via --type (default k3d, same flag shape as 'cluster create'). Also drop the stale kubectl mention from the help text — the CLI talks to Kubernetes via client-go.
|
Warning Review limit reached
Next review available in: 48 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe prerequisites command now supports k3d, EKS, and GKE prerequisite sets. The ChangesCluster prerequisite selection
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmd/prerequisites/prerequisites.go`:
- Around line 57-61: Update the recovery error message in the prerequisite check
flow around SetForClusterType to include the selected clusterType in the
suggested install command, so EKS and GKE checks direct users to install the
matching prerequisites rather than defaulting to k3d. Add or update a test
covering the generated message for a typed check.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: c588a7c3-3520-47e5-a25c-4fdf8933b1fc
📒 Files selected for processing (4)
cmd/prerequisites/prerequisites.gocmd/prerequisites/prerequisites_test.gointernal/cluster/prerequisites/sets.gointernal/cluster/prerequisites/sets_test.go
…d check 'check --type eks' with missing tools told the user to run a bare 'prerequisites install', which defaults back to k3d and installs the local toolset instead of the missing cloud one. The hint now carries the selected type; the default k3d stays unspoken so the common local command remains short.
Introduce models.ParseClusterType — the single parser behind every --type flag: canonical names, provider aliases (aws→eks, gcp→gke), and case-insensitivity. Wired into cluster create's flag validation (which now writes the canonical form back, so downstream casts never see a raw alias) and into prerequisites check/install, so the aliases behave identically across commands. Recovery hints echo the canonical type. Deliberately no 'amazon'/'google': provider abbreviations match how people name their clusters; brand names would grow the surface without adding a spelling anyone reaches for first.
The prerequisites command only covered the local k3d toolset (Docker, k3d, helm), while the terraform/AWS/gcloud requirements for cloud clusters were checked only inside 'cluster create'. Expose EKS/GKE sets through the shared prerequisites framework and let check/install target them via --type (default k3d, same flag shape as 'cluster create'). Also drop the stale kubectl mention from the help text — the CLI talks to Kubernetes via client-go.
Summary by CodeRabbit
--type/-toptions to prerequisite checks and installations, defaulting to k3d.