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 Sep 14, 2023
1 parent fa25b1a commit 814b4e5
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 @@ -21,6 +21,7 @@ type Volume struct {
BackingImageChecksum string `json:",string"`
CompressionMethod string `json:",string"`
StorageClassName string `json:",string"`
ObjectStoreBackup string `json:",string"`
}

type Snapshot struct {
Expand All @@ -44,6 +45,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 @@ -563,6 +563,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 @@ -584,6 +585,7 @@ func performBackup(bsDriver BackupStoreDriver, config *DeltaBackupConfig, delta
volume.BackingImageChecksum = config.Volume.BackingImageChecksum
volume.CompressionMethod = config.Volume.CompressionMethod
volume.StorageClassName = config.Volume.StorageClassName
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 @@ -76,6 +76,7 @@ func fillVolumeInfo(volume *Volume) *VolumeInfo {
BackingImageName: volume.BackingImageName,
BackingImageChecksum: volume.BackingImageChecksum,
StorageClassname: volume.StorageClassName,
ObjectStoreBackup: volume.ObjectStoreBackup,
}
}

Expand All @@ -90,6 +91,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 @@ -28,6 +28,7 @@ type VolumeInfo struct {
BackingImageName string
BackingImageChecksum string
StorageClassname string
ObjectStoreBackup string `json:",omitempty"`
}

type BackupInfo struct {
Expand All @@ -45,6 +46,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 814b4e5

Please sign in to comment.