fix(build): move EstimateBackupSize to platform-independent file
Some checks failed
CI/CD / Test (push) Failing after 4s
CI/CD / Generate SBOM (push) Has been skipped
CI/CD / Lint (push) Failing after 4s
CI/CD / Build (darwin-amd64) (push) Has been skipped
CI/CD / Build (linux-amd64) (push) Has been skipped
CI/CD / Build (darwin-arm64) (push) Has been skipped
CI/CD / Build (linux-arm64) (push) Has been skipped
CI/CD / Release (push) Has been skipped
CI/CD / Build & Push Docker Image (push) Has been skipped
CI/CD / Mirror to GitHub (push) Has been skipped
Some checks failed
CI/CD / Test (push) Failing after 4s
CI/CD / Generate SBOM (push) Has been skipped
CI/CD / Lint (push) Failing after 4s
CI/CD / Build (darwin-amd64) (push) Has been skipped
CI/CD / Build (linux-amd64) (push) Has been skipped
CI/CD / Build (darwin-arm64) (push) Has been skipped
CI/CD / Build (linux-arm64) (push) Has been skipped
CI/CD / Release (push) Has been skipped
CI/CD / Build & Push Docker Image (push) Has been skipped
CI/CD / Mirror to GitHub (push) Has been skipped
Fixes Windows, OpenBSD, and NetBSD builds by extracting EstimateBackupSize from disk_check.go (which has build tags excluding those platforms) to a new estimate.go file.
This commit is contained in:
@@ -110,12 +110,12 @@ func (b *BtrfsBackend) CreateSnapshot(ctx context.Context, opts SnapshotOptions)
|
||||
}
|
||||
|
||||
return &Snapshot{
|
||||
ID: fullPath,
|
||||
Backend: "btrfs",
|
||||
Source: b.config.Subvolume,
|
||||
Name: snapName,
|
||||
ID: fullPath,
|
||||
Backend: "btrfs",
|
||||
Source: b.config.Subvolume,
|
||||
Name: snapName,
|
||||
MountPoint: fullPath, // Btrfs snapshots are immediately accessible
|
||||
CreatedAt: time.Now(),
|
||||
CreatedAt: time.Now(),
|
||||
Metadata: map[string]string{
|
||||
"subvolume": b.config.Subvolume,
|
||||
"snapshot_path": snapPath,
|
||||
@@ -279,12 +279,12 @@ func (b *BtrfsBackend) ListSnapshots(ctx context.Context) ([]*Snapshot, error) {
|
||||
}
|
||||
|
||||
snapshots = append(snapshots, &Snapshot{
|
||||
ID: fullPath,
|
||||
Backend: "btrfs",
|
||||
Name: name,
|
||||
Source: b.config.Subvolume,
|
||||
ID: fullPath,
|
||||
Backend: "btrfs",
|
||||
Name: name,
|
||||
Source: b.config.Subvolume,
|
||||
MountPoint: fullPath,
|
||||
CreatedAt: createdAt,
|
||||
CreatedAt: createdAt,
|
||||
Metadata: map[string]string{
|
||||
"subvolume": b.config.Subvolume,
|
||||
},
|
||||
@@ -322,12 +322,12 @@ func (b *BtrfsBackend) listSnapshotsFromDir(ctx context.Context, snapPath string
|
||||
}
|
||||
|
||||
snapshots = append(snapshots, &Snapshot{
|
||||
ID: fullPath,
|
||||
Backend: "btrfs",
|
||||
Name: entry.Name(),
|
||||
Source: b.config.Subvolume,
|
||||
ID: fullPath,
|
||||
Backend: "btrfs",
|
||||
Name: entry.Name(),
|
||||
Source: b.config.Subvolume,
|
||||
MountPoint: fullPath,
|
||||
CreatedAt: createdAt,
|
||||
CreatedAt: createdAt,
|
||||
Metadata: map[string]string{
|
||||
"subvolume": b.config.Subvolume,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user