forked from wrenn/wrenn
Fix snapshot race, delete auth, sparse dd, default disk to 5GB
Snapshot race fix:
- Pre-mark sandbox as "paused" in DB before issuing CreateSnapshot and
PauseSandbox RPCs, preventing the reconciler from marking it "stopped"
during the flatten window when the sandbox is gone from the host
agent's in-memory map but DB still says "running"
- Revert status to "running" on RPC failure
- Check ctx.Err() before writing response to avoid writing to dead
connections when client disconnects during long snapshot operations
Delete auth fix:
- Block non-admin deletion of platform templates (team_id = all-zeros)
at DELETE /v1/snapshots/{name} with 403, preventing file deletion
before the team ownership check fails
Sparse dd:
- Add conv=sparse to dd in FlattenSnapshot so flattened images preserve
sparseness (~200MB actual vs 5GB logical)
Default disk size:
- Change default disk_size_mb from 20GB to 5GB across migration,
manager, service, build, and EnsureImageSizes
- Disable split-button dropdown arrow for platform templates in
dashboard snapshots page (teams cannot delete platform templates)
This commit is contained in:
@ -12,7 +12,7 @@ import (
|
||||
// than this are expanded at startup so that dm-snapshot sandboxes see the full
|
||||
// size without per-sandbox copies. The expansion is sparse — only metadata
|
||||
// changes; no physical disk is consumed beyond the original content.
|
||||
const DefaultDiskSizeMB = 20480 // 20 GB
|
||||
const DefaultDiskSizeMB = 5120 // 5 GB
|
||||
|
||||
// EnsureImageSizes walks the images directory and expands any rootfs.ext4 that
|
||||
// is smaller than the target size. This is idempotent: images already at or
|
||||
|
||||
@ -107,7 +107,7 @@ func (m *Manager) Create(ctx context.Context, sandboxID, template string, vcpus,
|
||||
memoryMB = 512
|
||||
}
|
||||
if diskSizeMB <= 0 {
|
||||
diskSizeMB = 20480 // 20 GB default
|
||||
diskSizeMB = 5120 // 5 GB default
|
||||
}
|
||||
|
||||
if template == "" {
|
||||
|
||||
Reference in New Issue
Block a user