Add size of the snapshot into the structure
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adam Štrauch 2021-10-30 13:29:35 +02:00
parent 81bcdcf00c
commit 7616eef12b
Signed by: cx
GPG Key ID: 018304FFA8988F8D

View File

@ -109,6 +109,12 @@ func (s *SnapshotProcessor) CreateSnapshot(appName string, labels []string) (str
return snapshot.KeyName(), fmt.Errorf("compression error: %v", err)
}
info, err := os.Stat(tmpSnapshotArchivePath)
if err != nil {
return snapshot.KeyName(), fmt.Errorf("temporary file stat error: %v", err)
}
snapshot.Labels = append(snapshot.Labels, fmt.Sprintf("size:%d", info.Size()))
// Clean after myself
defer func() {
err = os.Remove(tmpSnapshotArchivePath)