Commit Graph

40 Commits (02f3f5cd60ee3702d360a30a80c12c837abaa43f)

Author SHA1 Message Date
Bridget McErlean b9a8c0b254
Pass configured BSL credential to plugin via config (#3442)
* Load credentials and pass to ObjectStorage plugins

Update NewObjectBackupStore to take a CredentialsGetter which can be
used to get the credentials for a BackupStorageLocation if it has been
configured with a Credential. If the BSL has a credential, use that
SecretKeySelector to fetch the secret, write the contents to a temp file
and then pass that file through to the plugin via the config map using
the key `credentialsFile`. This relies on the plugin being able to use
this new config field.

This does not yet handle VolumeSnapshotLocations or ResticRepositories.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>

* Address code reviews

Add godocs and comments.
Improve formatting and test names.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>

* Address code reviews

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-03-04 13:43:15 -08:00
Bridget McErlean 38c08e087b
Replace NewObjectBackupStore with interface (#3329)
In preparation for modifying the instantiation of `BackupStores` to be
able to load credentials, change the function `NewObjectBackupStore` to
be an interface that is passed in to all controllers.

Previously, the function to get a new backup store was configurable but
for many controllers was fixed to use `NewObjectBackupStore`. This
change introduces an interface for getting the backup store and wraps
the functionality from `NewObjectBackupStore` in a type which implements
this interface. This will allow more flexibility when introducing
credentials for a specific backup store as it will allow us to create a
new `ObjectBackupStoreGetter` type which can be configured to add
credentials config when creating the ObjectBackupStore without needing
to change the API used by the controllers.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-02-08 13:04:08 -05:00
Ron Green 861cc78bcd refactor(external-snapshotter): bump to v4
Signed-off-by: Ron Green <11993626+georgettica@users.noreply.github.com>
2021-01-26 13:06:27 +02:00
Ashish Amarnath 577e87d1b8
Sync CSI API objects during backup sync (#2496)
* add changelog

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>

* Sync CSI API volumesnapshotcontents during backup sync

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
2020-05-06 08:00:05 -06:00
Nolan Brubaker eefd12b3e4 Rename CSI variables to be more descriptive
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2020-04-20 13:49:18 -04:00
Nolan Brubaker b4e18b489c Clean up object contents when other files fail
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2020-04-20 13:49:18 -04:00
Nolan Brubaker 6c3fc8c780 Addresss simple review feedback
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2020-04-20 13:49:18 -04:00
Nolan Brubaker 850554911f Reduce duplication in object storage uploads
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2020-04-20 13:49:18 -04:00
Nolan Brubaker 5bde12939e Address review feedback on object store
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2020-04-20 13:49:17 -04:00
Nolan Brubaker aff529e5d5 Upload CSI volumesnapshots associated with backup
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2020-04-20 13:49:17 -04:00
Nolan Brubaker b4be7eccb9 Document locations for CSI support
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2020-04-20 13:49:17 -04:00
Nolan Brubaker 7c87aebe5f Only add CA cert to plugin config if it's defined
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2020-03-31 13:59:37 -04:00
Samuel Lucidi 4d49b5971c
Support setting a custom CA bundle to use with a BackupStorageLocation (#2353)
* Support setting a custom CA certificate for a BSL

Signed-off-by: Sam Lucidi <slucidi@redhat.com>

* update CRDS

Signed-off-by: Sam Lucidi <slucidi@redhat.com>

* Add changelog for #2353

Signed-off-by: Sam Lucidi <slucidi@redhat.com>

* Clean up temp file from TestTempCACertFile

Signed-off-by: Sam Lucidi <slucidi@redhat.com>
2020-03-24 15:50:48 -06:00
Steve Kriss 4a5e70e00d allow plugins/ as a valid directory in the BSL bucket
Signed-off-by: Steve Kriss <krisss@vmware.com>
2020-03-17 11:14:41 -06:00
KubeKween d26bf05b33 Extract providers (#1985)
* Remove cloud providers and reorg code

Signed-off-by: Carlisia <carlisia@vmware.com>

* Update dependencies

Signed-off-by: Carlisia <carlisia@vmware.com>

* Fix tests

Signed-off-by: Carlisia <carlisia@vmware.com>

* fix dependency issues

Signed-off-by: Carlisia <carlisia@vmware.com>

* Delete dup test

Signed-off-by: Carlisia <carlisia@vmware.com>

* Add back spaces to file

Signed-off-by: Carlisia <carlisia@vmware.com>

* Remove and update docs

Signed-off-by: Carlisia <carlisia@vmware.com>

* Make the plugins flag required

Signed-off-by: Carlisia <carlisia@vmware.com>

* Add changelog

Signed-off-by: Carlisia <carlisia@vmware.com>

* Make the plugins flag conditional

Signed-off-by: Carlisia <carlisia@vmware.com>
2019-10-22 15:31:27 -07:00
Steve Kriss 48792ece1f Updates for org move to vmware-tanzu (#1920)
* update import paths to github.com/vmware-tanzu/...

Signed-off-by: Steve Kriss <krisss@vmware.com>

* update other GH org refs to vmware-tanzu

Signed-off-by: Steve Kriss <krisss@vmware.com>

* site and docs: update GH org to vmware-tanzu

Signed-off-by: Steve Kriss <krisss@vmware.com>

* update travis badge links on docs readmes

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-09-30 17:26:56 -04:00
Steve Kriss d96186473c sync controller: replace revision file with full diff each interval (#1892)
* backup sync controller: replace revision file with full diff each interval

Signed-off-by: Steve Kriss <krisss@vmware.com>

* remove getting/setting of metadata/revision file

Signed-off-by: Steve Kriss <krisss@vmware.com>

* changelog

Signed-off-by: Steve Kriss <krisss@vmware.com>

* tweak logging

Signed-off-by: Steve Kriss <krisss@vmware.com>

* don't keep podVolumeBackup log field around after syncing PVBs

Signed-off-by: Steve Kriss <krisss@vmware.com>

* update generated CRDs

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-09-27 16:23:11 -04:00
betta1 cfb663f795 Add the prefix to BSL config map so that object stores can use it when initializing (#1767)
Signed-off-by: Antony Bett <antony.bett@gmail.com>
2019-08-19 14:05:38 -06:00
Steve Kriss ffa3251efc move contents of pkg/util/test into pkg/test
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-07 08:26:00 -06:00
Steve Kriss a590fc9468
refactor GetBackupVolumeSnapshots and GetPodVolumeBackups (#1721)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-08-05 15:42:01 -06:00
Adnan Abdulhussein 2254635bcb print resource list metadata in velero backup describe --details (#1714)
* print resource list metadata in velero backup describe details

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* rewrite TestGetDownloadURL to test more scenarios

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* move backup printer helpers to backup_printer.go

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* move describe printer helpers back to backup_describer

and rename to prefix with describe* to indicate that they are used for the describe command

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* split backup and restore tests for TestGetDownloadURL

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* friendlier error message when backup resource list missing

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-08-05 12:23:20 -06:00
Adnan Abdulhussein 07525bd593 store backup resource list metadata in object storage (#1709)
* move backedUpItems to pkg/backup.Request struct

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* construct resource itemKey field from gvk

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* store backup resource list metadata in object storage

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* remove debug log

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* fix formatting

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* add missing license blocks and split BackupInfo struct lines

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* add test for checking BackedUpItems matches tarball contents

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>

* add comment to explain test

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-08-05 11:15:55 -06:00
Steve Kriss f2d06bc5e9 strip leading/trailing slashes from BSL bucket & prefix vals (#1694)
* strip leading/trailing slashes from BSL bucket & prefix vals

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-07-31 08:27:12 -07:00
KubeKween 3b9af8c654 Store PodVolumeBackups in obj storage & use as source of truth (#1577)
* Store PodVolumeBackups in object storage

Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-07-24 15:51:20 -04:00
Carlisia 38ccb40ca1
Add back code and tests
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-23 16:19:49 -07:00
Steve Kriss b03da3c0ed remove code referencing Ark API pkg
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:15:18 -06:00
Steve Kriss a111eed2af update license headers to Velero contributors (#1302)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-03-20 12:32:48 -07:00
KubeKween 73514a003b Move plugin interfaces to same package (#1264)
* Move plugin interfaces to same package

Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-03-14 16:35:06 -04:00
Steve Kriss 6bf837b233 address breaking changes in Azure SDK
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-02-28 15:33:05 -07:00
Nolan Brubaker 43714caaec Rename Ark to Velero!!!
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-02-04 17:35:22 -05:00
Andy Goldstein bca585162f Run 'make update' to update formatting
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-10-23 13:08:42 -04:00
Steve Kriss f014cab1fe backup describer: show snapshot summary by default, details optionally
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-22 12:08:37 -06:00
Steve Kriss cf2c27141b fix bugs in GetBackupVolumeSnapshots and add test
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 15:10:42 -06:00
Steve Kriss da9ed38c63 store volume snapshot info as JSON in backup storage
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-17 13:39:49 -06:00
Steve Kriss eb709b8f70 only sync a backup location if it's changed since last sync
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-10-03 08:05:06 -06:00
Steve Kriss 42b54586cd refactor to make valid dirs part of an object store layout
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-25 13:12:22 -06:00
Steve Kriss 8bc7e4f6aa store backups & restores in backups/, restores/ subdirs in obj storage
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-25 09:56:41 -06:00
Steve Kriss 7d8813a96c move ObjectStore mock into pkg/cloudprovider/mocks
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-06 10:53:58 -06:00
Steve Kriss f0edf7335f add a BackupStore to pkg/persistence that supports prefixes
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-06 10:53:58 -06:00
Steve Kriss af64069d65 create pkg/persistence and move relevant code from pkg/cloudprovider into it
Signed-off-by: Steve Kriss <steve@heptio.com>
2018-09-06 09:05:40 -06:00