Skip to content

Add unified-snapshots e2e: SDK write-path and delete-protection - #55

Closed
kneumoin wants to merge 1 commit into
mainfrom
feat/e2e-unified-snapshots-delete-protection
Closed

Add unified-snapshots e2e: SDK write-path and delete-protection#55
kneumoin wants to merge 1 commit into
mainfrom
feat/e2e-unified-snapshots-delete-protection

Conversation

@kneumoin

Copy link
Copy Markdown

New self-contained suite (tests/unified-snapshots) that validates the unified snapshot SDK write-path and the delete-protection guard against a live cluster, using the reference demo domain controllers (DemoVirtualDisk / DemoVirtualMachine).

What it verifies:

  • Readiness: a leaf VirtualDisk snapshot and a VirtualMachine tree snapshot both reach Ready, exercising the SDK capture phases (Planning -> Planned -> Finished) and the SnapshotContent -> Snapshot Ready mirror.
  • Marker write-path: the delete-protected marker (state-snapshotter.deckhouse.io/delete-protected=true) is stamped on every system-created child domain snapshot and on every SnapshotContent, but never on the user-created root snapshots.
  • Break-glass: with deckhouse.io/allow-delete=true a protected SnapshotContent can be deleted while the marker itself stays in place.
  • Delete guard (enforcement=Deny, gated by E2E_DELETE_GUARD=true): a direct DELETE of a protected object is denied, and removing/mutating the marker via UPDATE is denied. Under the default Audit,Warn this spec is skipped.
  • Cascade: deleting the unmarked user roots tears down the whole tree with no finalizer hang.

Runner notes:

  • Connects either through the storage-e2e SSH framework or, when SNAP_KUBECONFIG is set, directly to an already-reachable cluster (e.g. a persistent local tunnel) with no SSH.
  • API coordinates and storage class are overridable (SNAP_DEMO_GROUP, SNAP_STORAGE_CLASS, ...) so the suite can target either demo controller group.
  • The deny assertion is pinned to the delete-guard policy by name and accepts both Forbidden and Invalid, since a VAP validation without an explicit reason surfaces the denial as HTTP 422 Invalid.

New self-contained suite (tests/unified-snapshots) that validates the unified
snapshot SDK write-path and the delete-protection guard against a live cluster,
using the reference demo domain controllers (DemoVirtualDisk / DemoVirtualMachine).

What it verifies:
- Readiness: a leaf VirtualDisk snapshot and a VirtualMachine tree snapshot both
  reach Ready, exercising the SDK capture phases (Planning -> Planned -> Finished)
  and the SnapshotContent -> Snapshot Ready mirror.
- Marker write-path: the delete-protected marker
  (state-snapshotter.deckhouse.io/delete-protected=true) is stamped on every
  system-created child domain snapshot and on every SnapshotContent, but never on
  the user-created root snapshots.
- Break-glass: with deckhouse.io/allow-delete=true a protected SnapshotContent can
  be deleted while the marker itself stays in place.
- Delete guard (enforcement=Deny, gated by E2E_DELETE_GUARD=true): a direct DELETE
  of a protected object is denied, and removing/mutating the marker via UPDATE is
  denied. Under the default Audit,Warn this spec is skipped.
- Cascade: deleting the unmarked user roots tears down the whole tree with no
  finalizer hang.

Runner notes:
- Connects either through the storage-e2e SSH framework or, when SNAP_KUBECONFIG
  is set, directly to an already-reachable cluster (e.g. a persistent local
  tunnel) with no SSH.
- API coordinates and storage class are overridable (SNAP_DEMO_GROUP,
  SNAP_STORAGE_CLASS, ...) so the suite can target either demo controller group.
- The deny assertion is pinned to the delete-guard policy by name and accepts
  both Forbidden and Invalid, since a VAP validation without an explicit reason
  surfaces the denial as HTTP 422 Invalid.
@kneumoin
kneumoin requested a review from AleksZimin July 23, 2026 09:32
@kneumoin kneumoin self-assigned this Jul 23, 2026
@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: Go

Go / code-coverage/go

The overall coverage in commit b1c08f3 in the feat/e2e-unified-sna... branch remains at 24%, unchanged from commit 7b037e4 in the main branch.

@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Health
github.com/deckhouse/storage-e2e/internal/cluster 0%
github.com/deckhouse/storage-e2e/internal/config 56%
github.com/deckhouse/storage-e2e/internal/infrastructure/ssh 0%
github.com/deckhouse/storage-e2e/internal/infrastructure/ssh/v2 80%
github.com/deckhouse/storage-e2e/internal/kubernetes/clusterlock 75%
github.com/deckhouse/storage-e2e/internal/kubernetes/commander 53%
github.com/deckhouse/storage-e2e/internal/kubernetes/deckhouse 0%
github.com/deckhouse/storage-e2e/internal/kubernetes/kubeaccess 78%
github.com/deckhouse/storage-e2e/internal/kubernetes/storage 0%
github.com/deckhouse/storage-e2e/internal/kubernetes/virtualization 0%
github.com/deckhouse/storage-e2e/internal/logger 53%
github.com/deckhouse/storage-e2e/internal/provisioning/commander 16%
github.com/deckhouse/storage-e2e/internal/provisioning/dvp 63%
github.com/deckhouse/storage-e2e/internal/provisioning/dvp/vm 78%
github.com/deckhouse/storage-e2e/pkg/cluster 4%
github.com/deckhouse/storage-e2e/pkg/clusterprovider 89%
github.com/deckhouse/storage-e2e/pkg/clusterprovider/registry 100%
github.com/deckhouse/storage-e2e/pkg/commander 0%
github.com/deckhouse/storage-e2e/pkg/e2e 41%
github.com/deckhouse/storage-e2e/pkg/kubernetes 5%
github.com/deckhouse/storage-e2e/pkg/retry 94%
github.com/deckhouse/storage-e2e/pkg/storage-e2e 0%
github.com/deckhouse/storage-e2e/pkg/testkit 5%
Summary 24% (3773 / 15757)

@kneumoin kneumoin closed this Jul 27, 2026
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