Skip to content

feat(vm): add hidden --overlayfs flag to vm create (alpha)#703

Merged
jdewinne merged 4 commits intomainfrom
joshd/sc-135055/cmx-snapshots-overlayfs-for-rootfs-management
Apr 28, 2026
Merged

feat(vm): add hidden --overlayfs flag to vm create (alpha)#703
jdewinne merged 4 commits intomainfrom
joshd/sc-135055/cmx-snapshots-overlayfs-for-rootfs-management

Conversation

@jdewinne
Copy link
Copy Markdown
Member

@jdewinne jdewinne commented Apr 24, 2026

Summary

  • Adds a hidden alpha-stage --overlayfs boolean flag to replicated vm create that opts a VM into the new overlayfs-backed rootfs primitive.
  • Plumbs the flag from cobra → runnerArgskotsclient.CreateVMOpts → JSON "overlayfs" field on POST /v3/vm.
  • Behavior is unchanged when the flag is omitted (omitempty keeps the existing wire format identical for users who don't pass the flag).
  • Server-side gating is enforced by vandoor#9598 behind the cmx_overlayfs team feature flag; the underlying provisioner work is in reliability-matrix#2064.

Visibility

  • Flag is registered with MarkHidden("overlayfs"), mirroring the precedent set by --rbac-policy-name.
  • Description is prefixed with (alpha).
  • Not added to the cmd.Example block.

Refs: sc-135055

Test plan

  • go test ./cli/cmd/... ./pkg/kotsclient/... -count=1 — all pass
  • go vet ./... — clean
  • New end-to-end test (TestCreateVM_OverlayFSRequestBody) uses httptest.Server to assert the wire format: "overlayfs": true is sent when the field is set, and the field is absent when not (covers the omitempty invariant)
  • vm create --help | grep overlayfs returns empty (flag is hidden)
  • vm create --overlayfs <...> is accepted by cobra (no "unknown flag" error)

Adds an alpha-stage `--overlayfs` boolean flag to `replicated vm create`
that opts a VM into the new overlayfs-backed rootfs primitive. The flag
is hidden from `--help` and gated server-side by the `cmx_overlayfs`
feature flag (vandoor#9598); behavior is unchanged when the flag is
omitted.

Refs: sc-135055
Companions: replicatedhq/reliability-matrix#2064, replicatedhq/vandoor#9598
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 558f20a. Configure here.

Comment thread cli/cmd/vm_create_test.go Outdated
testify's `require.NoError` calls t.FailNow(), which calls runtime.Goexit().
Per testing.T docs, FailNow is only safe from the test goroutine — calling
it from the httptest server handler goroutine can hang or panic instead of
failing cleanly. Capture errors into a variable inside the handler and
assert from the test goroutine after the request completes.
@jdewinne jdewinne merged commit 9e4f2f6 into main Apr 28, 2026
6 checks passed
@jdewinne jdewinne deleted the joshd/sc-135055/cmx-snapshots-overlayfs-for-rootfs-management branch April 28, 2026 19:06
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