Skip to content

feat(network): add verda network and subnet list, create and delete for mk8s (beta) - #77

Merged
yutkin merged 7 commits into
mainfrom
feat/sdn-120-network-mk8s-min
Nov 18, 2026
Merged

yutkin merged 7 commits into
mainfrom
feat/sdn-120-network-mk8s-min

Conversation

@yutkin

@yutkin yutkin commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds verda network (beta). A user can list, create and delete private networks and their subnets.

verda network      list · create · delete
└── subnet         list · create · delete
 go.mod                          # SDK v1.7.1 → v1.9.0, Go 1.26.10 → 1.26.11, otel v1.45.0 → v1.47.0
 internal/verda-cli/cmd/
 ├── cmd.go                      # registers `network`
+└── network/                    # the six commands, CIDR checks, docs
 tests/integration/
+    network_test.go             # one read-only list test
  • Commands take IDs, not names. subnet delete also needs --network.
  • On a terminal, missing values open a wizard (create) or a picker (delete).
  • subnet create without --cidr uses the first free /24 in 10.0.0.0/16. The API checks --cidr.
  • --default sends is_default: true, --default=false sends false, and no flag leaves it to the API.
  • Delete shows a warning and asks. Agent mode needs --yes.

Dependency updates:

Update Why
SDK v1.9.0 is_default on subnet create is optional, so --default=false can be sent.
Go 1.26.11, otel v1.47.0 Fix GO-2026-6859 and GHSA-q7gw-24fr-5p69. The Security Scan fails without them.
yaml v3.0.5, x/sys v0.48.0 Required by otel v1.47.0.

Evidence

  • Before: verda --help has no network command.
    After:
    $ verda network --help
      create      Create a private network
      delete      Delete a private network with its subnets
      list        List private networks
      subnet      Manage the subnets of private networks
    
    $ verda network subnet --help
      create      Create a subnet in a private network
      delete      Delete a subnet
      list        List subnets of all networks, or of one
    
    $ verda --agent network create; echo "exit=$?"
    {"error":{"code":"MISSING_REQUIRED_FLAGS","message":"required flags not provided","details":{"missing":["--name"]}}}
    exit=2
    
    $ verda --agent network delete $NETWORK_ID; echo "exit=$?"
    {"error":{"code":"CONFIRMATION_REQUIRED","message":"destructive action \"delete\" requires --yes in agent mode","details":{"action":"delete"}}}
    exit=2
    
  • Unit tests run each command against an in-memory API. They check the request body for is_default (absent, true, false) and for a trimmed --cidr.
  • go test -race ./..., make lint (0 issues) and make fix.check pass.
  • Production run (api.verda.com, 50ef0bb): 115 cases, 0 failures. It covers all six commands in table, JSON, YAML and agent mode, the terminal wizards and pickers, delete refused with an attached instance (409), the ROUTE column, --default, and auto mode. A deploy with no subnet into the default auto network got a 10.128.16.0/20 subnet. Everything created was deleted.

Merge Danger

Door: two-way

The commands are new and marked beta. Reverting the PR removes them.

Blast Radius: small

  • The Go, otel and SDK updates apply to every command. The existing tests pass on them.
  • The two delete commands are destructive. They warn, ask for confirmation, and need --yes in agent mode. The API refuses to delete a network or subnet that has instances.

🤖 Generated with Claude Code

@yutkin yutkin changed the title feat(network): add verda network list and create and the shared helpers that mk8s needs (beta) feat(network): add verda network list, create, delete and subnet list, delete, with the helpers that mk8s needs (beta) Nov 17, 2026
@yutkin yutkin changed the title feat(network): add verda network list, create, delete and subnet list, delete, with the helpers that mk8s needs (beta) feat(network): add verda network and subnet list, create and delete for mk8s (beta) Nov 17, 2026
@yutkin
yutkin force-pushed the feat/sdn-120-network-mk8s-min branch 2 times, most recently from 5fbdf51 to 15e689e Compare November 17, 2026 15:20
…beta)

verda network list, create and delete manage private networks.
verda network subnet list, create and delete manage their subnets.
Commands take IDs. On a terminal, missing values open a wizard
(create) or a picker (delete).

subnet create without --cidr uses the first free /24 in 10.0.0.0/16.
It refuses a CIDR that overlaps another subnet of the network before
the API call. --default sends is_default true, --default=false sends
false, and no flag leaves it to the API.

Delete warns, asks for confirmation, and needs --yes in agent mode.

Dependencies: verdacloud-sdk-go v1.9.0 (optional is_default on subnet
create), Go 1.26.11 and otel v1.47.0 (GO-2026-6859,
GHSA-q7gw-24fr-5p69).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yutkin
yutkin force-pushed the feat/sdn-120-network-mk8s-min branch from 15e689e to 50ef0bb Compare November 17, 2026 15:52
For the first subnet in a location the wizard skipped the default
step, and the skip reset the flag. The request then had no
is_default, so the API made the subnet the default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yutkin
yutkin marked this pull request as ready for review November 17, 2026 16:16
Comment thread internal/verda-cli/cmd/network/cidr.go Resolved
yutkin and others added 2 commits November 17, 2026 18:38
The CLI no longer checks --cidr against RFC 1918 ranges, a /29
minimum, canonical form or overlaps with other subnets. The API
decides what it accepts. The automatic free /24 stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- --cidr is checked for IPv4 format only, as the SDK does, so a bad
  value is VALIDATION_ERROR again and the wizard asks again. The API
  still decides which ranges it accepts.
- A blank network or subnet ID counts as missing.
- network create checks --mode, and subnet create checks --name and
  --cidr, before any prompt or API call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nicksemin

This comment was marked as outdated.

nicksemin
nicksemin previously approved these changes Nov 17, 2026

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

LGTM but the shared logic for checking whether the tty is interactive or not.
Up to you if you want to fix it or not 🚀

@yutkin

yutkin commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

LGTM but the shared logic for checking whether the tty is interactive or not. Up to you if you want to fix it or not 🚀

This fix would require touching multiple files which are not directly related to PR. It's planned to fix separately. The PR is already big.

Auto mode creates subnets only for the default network, so a
non-default auto network needs subnet create too. Accept --mode in
any case. Make the create help say when the CLI prompts, and list
subnet create in the root CLAUDE.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yutkin and others added 2 commits November 18, 2026 10:42
list, subnet list and subnet delete tests had no file of their own.
The tests do not change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… default

Without is_default, the API makes a new subnet the default when the
network has no default subnet in its location, not only for the first
subnet. The wizard now skips the question in that case, so it gives the
same result as a create without --default. Correct the help and the
package notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yutkin
yutkin requested review from ajmyyra and nicksemin November 18, 2026 11:22
@yutkin
yutkin merged commit ad8164f into main Nov 18, 2026
13 checks passed
jaakkovarjo added a commit that referenced this pull request Nov 18, 2026
Resolves conflicts from the network feature (#77) landing on main:
- CLAUDE.md: keep the new cmd/network row and our GA serverless row
  (drop the stale beta/VERDA_BATCHJOB_ENABLED serverless row).
- go.mod: take verdacloud-sdk-go v1.9.0 (the network feature needs it);
  serverless builds and tests pass against it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

3 participants