Skip to content

feat(vks): flag revamp (enabled/disabled toggles, TIGERA, os rocky) + drop get-nodegroup-events#19

Merged
vks-team merged 3 commits into
mainfrom
feat/cli-flag-revamp
Jun 30, 2026
Merged

feat(vks): flag revamp (enabled/disabled toggles, TIGERA, os rocky) + drop get-nodegroup-events#19
vks-team merged 3 commits into
mainfrom
feat/cli-flag-revamp

Conversation

@vks-team

Copy link
Copy Markdown
Contributor

Summary

  1. Remove get-nodegroup-events command (file, registration, docs, nav, README).
  2. network-type: CALICOTIGERA in --help, completion, and the --cidr-required validation (API accepts TIGERA, not CALICO).
  3. --os: add rockyubuntu, linux, rocky (default ubuntu).
  4. Toggle flags → <enabled|disabled> (via a shared parseToggle helper that rejects invalid values):
    • create-cluster: --private-cluster (default disabled), --private-nodes (disabled), --load-balancer-plugin (enabled), --block-store-csi-plugin (enabled)
    • create-nodegroup: --private-nodes (disabled)
    • update-cluster: --load-balancer-plugin / --block-store-csi-plugin (unset = unchanged) — replaces the old --enabled-*/--no-* pairs

(Task "get-versions" dropped — list-cluster-versions already covers it.)

⚠️ Breaking

Old flags removed: --enable-private-cluster, --enable-private-nodes, --no-load-balancer-plugin, --no-block-store-csi-plugin (create-cluster); --enable-private-nodes (create-nodegroup); --enabled-*/--no-* plugin flags (update-cluster). CALICO no longer accepted for --network-type. get-nodegroup-events removed.

Test plan

  • build / vet / go test ./... pass
  • --help shows new flags + defaults; get-nodegroup-events gone
  • invalid toggle value rejected (--private-cluster bogus → clear error)
  • completion: --os → ubuntu/linux/rocky; --network-type → TIGERA/...; toggles → enabled/disabled
  • smoke-test create-cluster/create-nodegroup against a live project

🤖 Generated with Claude Code

tytv2 and others added 2 commits June 29, 2026 21:50
- remove get-nodegroup-events command (+ docs/nav)
- network-type: CALICO -> TIGERA (help, completion, cidr validation)
- --os: add rocky (ubuntu, linux, rocky)
- replace boolean toggle flags with explicit enabled|disabled string flags:
  create-cluster: --private-cluster, --private-nodes, --load-balancer-plugin,
  --block-store-csi-plugin; create-nodegroup: --private-nodes;
  update-cluster: --load-balancer-plugin/--block-store-csi-plugin (unset=unchanged)
  via a shared parseToggle helper (rejects invalid values)
- completion + docs updated; changelog (api-change)

BREAKING: --enable-private-cluster/--enable-private-nodes/--no-*-plugin and
update-cluster's --enabled-*/--no-* flags are replaced; CALICO no longer accepted.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
config.LoadConfig returns (nil, err) when the profile is absent from the
credentials file; runConfigure ignored the error and dereferenced nil at
configure.go:47. Guard for err/nil and start from empty defaults so
`grn configure --profile <new>` creates the profile instead of crashing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vks-team

Copy link
Copy Markdown
Contributor Author

Added a bonus bugfix in e10fb6f: grn configure --profile <name> no longer panics for a profile that doesn't exist yet.

Root cause: config.LoadConfig returns (nil, err) when the profile is absent from the credentials file, but runConfigure ignored the error and dereferenced nil at configure.go:47 (the crash you hit on --profile prod-han-qc2). Now it guards for err/nil and starts from empty defaults so the profile can be created.

Verified: grn configure --profile <new> prompts and saves without crashing; full test suite passes.

Nested group commands (grn vks, grn vserver and its sub-groups) used
Run: cmd.Help() with cobra's default arg handling, which (unlike the root)
does not reject unknown subcommands — so `grn vks foobar` printed help and
exited 0. Add Args: cobra.NoArgs to every group command so an unknown
subcommand yields an "unknown command" error and a non-zero exit, while bare
invocation still shows help.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vks-team vks-team merged commit e766021 into main Jun 30, 2026
4 checks passed
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