Skip to content

Commit

Permalink
object store: add fields for object store backup
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Röhrich <moritz.rohrich@suse.com>
  • Loading branch information
m-ildefons committed Nov 28, 2023
1 parent af339bb commit 9f0433b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backupstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type Volume struct {
CompressionMethod string `json:",string"`
StorageClassName string `json:",string"`
BackendStoreDriver string `json:",string"`
ObjectStoreBackup string `json:",string"`
}

type Snapshot struct {
Expand All @@ -46,6 +47,7 @@ type Backup struct {
Labels map[string]string
IsIncremental bool
CompressionMethod string
ObjectStoreBackup string

ProcessingBlocks *ProcessingBlocks

Expand Down
2 changes: 2 additions & 0 deletions deltablock.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ func performBackup(bsDriver BackupStoreDriver, config *DeltaBackupConfig, delta
backup.CreatedTime = util.Now()
backup.Size = int64(len(backup.Blocks)) * DEFAULT_BLOCK_SIZE
backup.Labels = config.Labels
backup.ObjectStoreBackup = volume.ObjectStoreBackup
backup.IsIncremental = lastBackup != nil

if err := saveBackup(bsDriver, backup); err != nil {
Expand All @@ -554,6 +555,7 @@ func performBackup(bsDriver BackupStoreDriver, config *DeltaBackupConfig, delta
volume.CompressionMethod = config.Volume.CompressionMethod
volume.StorageClassName = config.Volume.StorageClassName
volume.BackendStoreDriver = config.Volume.BackendStoreDriver
volume.ObjectStoreBackup = config.Volume.ObjectStoreBackup

if err := saveVolume(bsDriver, volume); err != nil {
return progress.progress, "", err
Expand Down
2 changes: 2 additions & 0 deletions inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func fillVolumeInfo(volume *Volume) *VolumeInfo {
BackingImageChecksum: volume.BackingImageChecksum,
StorageClassname: volume.StorageClassName,
BackendStoreDriver: volume.BackendStoreDriver,
ObjectStoreBackup: volume.ObjectStoreBackup,
}
}

Expand All @@ -91,6 +92,7 @@ func fillBackupInfo(backup *Backup, destURL string) *BackupInfo {
Labels: backup.Labels,
IsIncremental: backup.IsIncremental,
CompressionMethod: backup.CompressionMethod,
ObjectStoreBackup: backup.ObjectStoreBackup,
}
}

Expand Down
2 changes: 2 additions & 0 deletions list.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type VolumeInfo struct {
BackingImageChecksum string
StorageClassname string
BackendStoreDriver string
ObjectStoreBackup string `json:",omitempty"`
}

type BackupInfo struct {
Expand All @@ -46,6 +47,7 @@ type BackupInfo struct {
VolumeSize int64 `json:",string,omitempty"`
VolumeCreated string `json:",omitempty"`
VolumeBackingImageName string `json:",omitempty"`
ObjectStoreBackup string `json:",omitempty"`

Messages map[types.MessageType]string
}
Expand Down

0 comments on commit 9f0433b

Please sign in to comment.