forked from vmware-tanzu/velero
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds <backup-name>-itemsnapshots.gz file to backup (when provided). (v…
…mware-tanzu#4429) * Adds <backup-name>-itemsnapshots.gz file to backup (when provided). Also adds DownloadTargetKindBackupItemSnapshots type to allow downloading. Updated object store unit test Fixes vmware-tanzu#3758 Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com> * Removed redundant checks Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>
- Loading branch information
Showing
9 changed files
with
176 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Added `<backup name>`-itemsnapshots.json.gz to the backup format. This file exists | ||
when item snapshots are taken and contains an array of volume.Itemsnapshots | ||
containing the information about the snapshots. This will not be used unless | ||
upload progress monitoring and item snapshots are enabled and an ItemSnapshot | ||
plugin is used to take snapshots. | ||
|
||
Also added DownloadTargetKindBackupItemSnapshots for retrieving the signed URL to download only the `<backup name>`-itemsnapshots.json.gz part of a backup for use by | ||
`velero backup describe`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
Copyright the Velero contributors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package volume | ||
|
||
import isv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1" | ||
|
||
// ItemSnapshot stores information about an item snapshot (includes volumes and other Astrolabe objects) taken as | ||
// part of a Velero backup. | ||
type ItemSnapshot struct { | ||
Spec ItemSnapshotSpec `json:"spec"` | ||
|
||
Status ItemSnapshotStatus `json:"status"` | ||
} | ||
|
||
type ItemSnapshotSpec struct { | ||
// ItemSnapshotter is the name of the ItemSnapshotter plugin that took the snapshot | ||
ItemSnapshotter string `json:"itemSnapshotter"` | ||
|
||
// BackupName is the name of the Velero backup this snapshot | ||
// is associated with. | ||
BackupName string `json:"backupName"` | ||
|
||
// BackupUID is the UID of the Velero backup this snapshot | ||
// is associated with. | ||
BackupUID string `json:"backupUID"` | ||
|
||
// Location is the name of the location where this snapshot is stored. | ||
Location string `json:"location"` | ||
|
||
// Kubernetes resource identifier for the item | ||
ResourceIdentifier string "json:resourceIdentifier" | ||
} | ||
|
||
type ItemSnapshotStatus struct { | ||
// ProviderSnapshotID is the ID of the snapshot taken by the ItemSnapshotter | ||
ProviderSnapshotID string `json:"providerSnapshotID,omitempty"` | ||
|
||
// Metadata is the metadata returned with the snapshot to be returned to the ItemSnapshotter at restore time | ||
Metadata map[string]string `json:"metadata,omitempty"` | ||
|
||
// Phase is the current state of the ItemSnapshot. | ||
Phase isv1.SnapshotPhase `json:"phase,omitempty"` | ||
} |