Skip to content

feat(prerequisites): add --type k3d|eks|gke flag to check/install - #288

Merged
oleg-flamingocx merged 3 commits into
mainfrom
fix/prerequisites-type-flag
Aug 6, 2026
Merged

feat(prerequisites): add --type k3d|eks|gke flag to check/install#288
oleg-flamingocx merged 3 commits into
mainfrom
fix/prerequisites-type-flag

Conversation

@oleg-flamingocx

@oleg-flamingocx oleg-flamingocx commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

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

  • New Features
    • Added cluster-specific prerequisite support for k3d, EKS, and GKE.
    • Added --type/-t options to prerequisite checks and installations, defaulting to k3d.
    • Added Terraform and cloud authentication prerequisites for EKS and GKE.
    • Updated command help and examples with supported cluster types.
  • Bug Fixes
    • Unsupported cluster types now return clear validation errors listing accepted values.

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.
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@oleg-flamingocx, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fc2455e9-145a-4e33-a4df-a1e053473b0a

📥 Commits

Reviewing files that changed from the base of the PR and between d2845b5 and 77d1737.

📒 Files selected for processing (5)
  • cmd/prerequisites/prerequisites.go
  • cmd/prerequisites/prerequisites_test.go
  • internal/cluster/models/cluster.go
  • internal/cluster/models/cluster_test.go
  • internal/cluster/models/flags.go
📝 Walkthrough

Walkthrough

The prerequisites command now supports k3d, EKS, and GKE prerequisite sets. The check and install subcommands accept --type and -t, default to k3d, and reject unsupported cluster types.

Changes

Cluster prerequisite selection

Layer / File(s) Summary
Cluster prerequisite sets
internal/cluster/prerequisites/sets.go, internal/cluster/prerequisites/sets_test.go
Adds Terraform and cloud authentication prerequisites for EKS and GKE. Maps supported cluster types to sets and validates set structure and mappings.
Prerequisites command type selection
cmd/prerequisites/prerequisites.go, cmd/prerequisites/prerequisites_test.go
Adds --type and -t to check and install. Resolves the selected set, updates help examples, and reports unsupported types. Tests cover defaults, shorthand usage, and invalid values.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: ivan-flamingo, yaroslavmokflmg

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a --type flag for k3d, EKS, and GKE to the prerequisites commands.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/prerequisites-type-flag

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4b91628 and d2845b5.

📒 Files selected for processing (4)
  • cmd/prerequisites/prerequisites.go
  • cmd/prerequisites/prerequisites_test.go
  • internal/cluster/prerequisites/sets.go
  • internal/cluster/prerequisites/sets_test.go

Comment thread cmd/prerequisites/prerequisites.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.
@oleg-flamingocx
oleg-flamingocx enabled auto-merge (squash) August 6, 2026 08:16
@oleg-flamingocx
oleg-flamingocx merged commit eb050ae into main Aug 6, 2026
11 of 13 checks passed
@oleg-flamingocx
oleg-flamingocx deleted the fix/prerequisites-type-flag branch August 6, 2026 08:16
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.

2 participants