John Naulty Jr and Carlisia Campos
cd860771c2
Add error return to pvRenamer func ( #2138 )
...
Migrate logic from NewUUID function into the pvRenamer function.
PR #2133 switched to a new NewUUID function that returns an error, but
the invocation of that function needs to happen within the pvRenamer
closure. Because the new function returns an error, the pvRenamer should
return the error, the signature needs to be changed and the return
checked.
Signed-off-by: John Naulty <johnnaulty@bitgo.com >
2019-12-17 10:23:58 -08:00
John Naulty
ff889283b8
Switch from satori/go.uuid to gofrs/uuid
...
satori/go.uuid has a known issue with random uuid generation.
gofrs/uuid is still maintained and has fixed the random uuid generation
issue present in satori/go.uuid
Signed-off-by: John Naulty <johnnaulty@bitgo.com >
2019-12-14 10:27:00 -08:00
Steve Kriss and Carlisia Campos
7c60829f38
bug fix: don't restore cluster-scoped resources by default when restoring specific namespaces ( #2118 )
...
* add failing test case for bug
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-12-12 12:45:41 -08:00
Roman Klimenko and Carlisia Campos
87be775139
Add support for private registry with custom port in restic-helper image ( #1999 )
...
* Add support for private registry with custom port in restic-helper image definition
Signed-off-by: Roman Klimenko <cognoz@ya.ru >
2019-12-04 08:01:39 -08:00
Steve Kriss and GitHub
4fb1bc2ef3
restic: don't try to restore PVBs with no snapshotID ( #2031 )
...
* restic: don't try to restore PVBs with no snapshotID
Signed-off-by: Steve Kriss <krisss@vmware.com >
* changelog
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-11-04 16:18:08 -07:00
KubeKween and Adnan Abdulhussein
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
Adnan Abdulhussein and KubeKween
69f993aebd
update gcr.io/heptio-images/ references to velero/ ( #1988 )
...
* update gcr.io/heptio-images/ references to velero/
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com >
2019-10-22 14:39:43 -07:00
Alexander Demichev and Steve Kriss
1564317cef
Restore action for cluster/namespace role bindings ( #1974 )
...
Signed-off-by: Alexander Demichev <ademicev@redhat.com >
2019-10-21 15:11:26 -06:00
KubeKween and Nolan Brubaker
e054a2f0b3
Make "not restored" message a bit better ( #1901 )
...
* Make "not restoring" message a bit better
Signed-off-by: Carlisia <carlisia@vmware.com >
* Tweak error msg
Signed-off-by: Carlisia <carlisia@vmware.com >
* Address feedback
Signed-off-by: Carlisia <carlisia@vmware.com >
2019-10-01 16:47:21 -04:00
Steve Kriss and Nolan Brubaker
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 and KubeKween
2e849dcb99
Fix for #1888 : check item's original namespace, not remapped one, for inclusion/exclusion ( #1909 )
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-09-25 18:01:16 -07:00
Steve Kriss and GitHub
29f29f9d61
Merge pull request #1828 from carlisia/c-1826-test-bug
...
Sort mounts in test case to avoid intermittent fail
2019-09-03 12:39:59 -06:00
Carlisia
966222ac0f
Sort mounts in test case to avoid intermitent fail
...
Closes #1826 .
Signed-off-by: Carlisia <carlisia@vmware.com >
2019-08-29 17:55:13 -07:00
Steve Kriss and KubeKween
e210626a36
create pkg/archive with functionality extracted from pkg/restore ( #1801 )
...
* move pkg/restore's backup extractor to pkg/archive
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-08-28 18:03:01 -07:00
Steve Kriss and Adnan Abdulhussein
60f9898ca0
restore: rename PV when remapping a namespace if PV exists in-cluster ( #1779 )
...
* rename PV during restore when cloning a namespace
Signed-off-by: Steve Kriss <krisss@vmware.com >
* rename func and vars, switch to if..else
Signed-off-by: Steve Kriss <krisss@vmware.com >
* make pv renamer func configurable for testing purposes
Signed-off-by: Steve Kriss <krisss@vmware.com >
* add unit test cases
Signed-off-by: Steve Kriss <krisss@vmware.com >
* changelog
Signed-off-by: Steve Kriss <krisss@vmware.com >
* address review feedback
Signed-off-by: Steve Kriss <krisss@vmware.com >
* address review feedback
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-08-27 16:42:38 -07:00
KubeKween and Adnan Abdulhussein
6b66a49a21
Unit tests for restic restore ( #1747 )
...
* Add unit tests for PVB restore functionality
Signed-off-by: Carlisia <carlisiac@vmware.com >
* Add tests for restore action
Signed-off-by: Carlisia <carlisiac@vmware.com >
* TestRestoreWithRestic wip
Signed-off-by: Carlisia <carlisiac@vmware.com >
* Fix build
Signed-off-by: Carlisia <carlisiac@vmware.com >
* Mockery
Signed-off-by: Carlisia <carlisiac@vmware.com >
* Cleanup mocks
Signed-off-by: Carlisia <carlisiac@vmware.com >
* Remove unused mock
Signed-off-by: Carlisia <carlisiac@vmware.com >
* Use consistent pattern for test building
Signed-off-by: Carlisia <carlisia@vmware.com >
* Test cleanup
Signed-off-by: Carlisia <carlisia@vmware.com >
* Better godoc
Signed-off-by: Carlisia <carlisia@vmware.com >
* Improve test cases
Signed-off-by: Carlisia <carlisia@vmware.com >
* Fix build
Signed-off-by: Carlisia <carlisia@vmware.com >
* Minor test cleanup
Signed-off-by: Carlisia <carlisia@vmware.com >
* New pvb test input names
Signed-off-by: Carlisia <carlisia@vmware.com >
2019-08-27 15:49:23 -07: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 and KubeKween
80692a8a39
Properly restore PVs with a reclaim policy of Retain and restic backups ( #1713 )
...
* reorganize persistent volume restore code for clarity
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-08-06 13:40:35 -07:00
KubeKween and Adnan Abdulhussein
4accb8512a
Restore from PodVolumeBackups ( #1723 )
...
* Restore from PodVolumeBackups
Signed-off-by: Carlisia <carlisiac@vmware.com >
* Partially address code reviews
Signed-off-by: Carlisia <carlisiac@vmware.com >
* Partially address code reviews #2
Signed-off-by: Carlisia <carlisiac@vmware.com >
* Clean up struct
Signed-off-by: Carlisia <carlisiac@vmware.com >
* Fix log messages
Signed-off-by: Carlisia <carlisiac@vmware.com >
* Fix tests
Signed-off-by: Carlisia <carlisiac@vmware.com >
* Clean up
Signed-off-by: Carlisia <carlisiac@vmware.com >
* Add changelog
Signed-off-by: Carlisia <carlisiac@vmware.com >
2019-08-06 13:17:36 -07:00
Nolan Brubaker and Steve Kriss
a4e70456a1
Add resource limits to restic init container ( #1677 )
...
* Add resource limits to restic init container
Fixes #1201
Signed-off-by: Nolan Brubaker <brubakern@vmware.com >
* Start restic restore item action tests
Signed-off-by: Nolan Brubaker <brubakern@vmware.com >
* Get initial tests for restore action working
Signed-off-by: Nolan Brubaker <brubakern@vmware.com >
* Add new test case
Signed-off-by: Nolan Brubaker <brubakern@vmware.com >
* Move resource parsing into a shared function
Signed-off-by: Nolan Brubaker <brubakern@vmware.com >
* Fetch request/limits from plugin's ConfigMap
Signed-off-by: Nolan Brubaker <brubakern@vmware.com >
* Use builders
Signed-off-by: Nolan Brubaker <brubakern@vmware.com >
* Use moved ParseResourceRequirements function
Signed-off-by: Nolan Brubaker <brubakern@vmware.com >
* Move init container building inline
Signed-off-by: Nolan Brubaker <brubakern@vmware.com >
* Drop CPU limit down a bit and clarify error message
Signed-off-by: Nolan Brubaker <brubakern@vmware.com >
* Fix godoc
Signed-off-by: Nolan Brubaker <brubakern@vmware.com >
* Add resource requirements to doc
Signed-off-by: Nolan Brubaker <brubakern@vmware.com >
2019-08-05 13:18:11 -06:00
Steve Kriss and KubeKween
4543258970
Update tests to use object builders in pkg/builder ( #1707 )
...
* add pkg/builder with BackupBuilder and ObjectMeta functional options
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-07-31 07:46:48 -07:00
KubeKween and Nolan Brubaker
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
Steve Kriss and Adnan Abdulhussein
1bb167ef90
add restore item action to change PVC/PV storage class name ( #1621 )
...
* add restore item action to change PVC/PV storage class name
Signed-off-by: Steve Kriss <krisss@vmware.com >
* code review
Signed-off-by: Steve Kriss <krisss@vmware.com >
* change existing plugin names to lowercase/hyphenated
Signed-off-by: Steve Kriss <krisss@vmware.com >
* add validation for new storage class name
Signed-off-by: Steve Kriss <krisss@vmware.com >
* add test cases
Signed-off-by: Steve Kriss <krisss@vmware.com >
* changelog
Signed-off-by: Steve Kriss <krisss@vmware.com >
* fix imports
Signed-off-by: Steve Kriss <krisss@vmware.com >
* update plugin names to be more consistent
Signed-off-by: Steve Kriss <krisss@vmware.com >
* update unit tests to use pkg/test object constructors
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-07-15 11:19:38 -07:00
Nolan Brubaker and KubeKween
63964fc6f9
Append "/mount" to directory for CSI volumes ( #1615 )
...
CSI volumes are mounted one level deeper than "native" kubernetes
volumes, and this needs to be appended for proper restic support.
Fixes #1313 .
Signed-off-by: Nolan Brubaker <brubakern@vmware.com >
2019-07-10 15:16:21 -07:00
Steve Kriss
d1025f7547
rename restore_new_test.go to restore_test.go
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-07-10 09:59:27 -06:00
Steve Kriss
678c02c560
move contents of restore_test.go into other files and delete it
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-07-10 09:59:01 -06:00
Steve Kriss
567802299b
move PV/PVC setup helpers into pkg/test
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-07-03 08:50:11 -06:00
Steve Kriss
adb93c33b1
migrate restore PV tests
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-07-03 08:50:09 -06:00
Steve Kriss
db393ec199
properly filter additional items returned from restore item actions
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-06-28 08:59:23 -06:00
Steve Kriss and Adnan Abdulhussein
022099a62e
Refactor pkg/restore tests (part 3) ( #1611 )
...
* add modifying restore item action tests
Signed-off-by: Steve Kriss <krisss@vmware.com >
* add restore item action additional items tests
Signed-off-by: Steve Kriss <krisss@vmware.com >
* migrate ShouldRestore test
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-06-27 15:43:59 -07:00
Steve Kriss
75a96dfa92
fix bugs in finding applicable restore item actions
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-06-27 13:06:16 -06:00
Steve Kriss and Adnan Abdulhussein
81c2adc059
Refactor pkg/restore tests (part 2) ( #1606 )
...
* update TestPrioritizeResources to use real discovery helper
Signed-off-by: Steve Kriss <krisss@vmware.com >
* migrate invalid tarball contents tests
Signed-off-by: Steve Kriss <krisss@vmware.com >
* migrate item restore tests
Signed-off-by: Steve Kriss <krisss@vmware.com >
* migrate restore item action tests
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-06-27 11:57:47 -07:00
Steve Kriss
0089fa4d93
migrate restore resource priorities test
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-06-26 10:24:02 -06:00
Steve Kriss
5d8ba1b90d
migrate namespace mapping tests
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-06-24 16:57:30 -06:00
Steve Kriss
1a339f06ac
migrate restore resource filtering tests
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-06-24 15:53:15 -06:00
Nolan Brubaker and GitHub
67512a3808
Merge pull request #1595 from skriss/restore-test-refactor-1
...
initial refactoring for pkg/restore tests
2019-06-24 17:08:51 -04:00
Nolan Brubaker and GitHub
37c7b618ad
Merge pull request #1598 from skriss/rm-has-controller-owner
...
remove unused hasControllerOwner func and tests
2019-06-24 16:51:28 -04:00
Steve Kriss and Adnan Abdulhussein
19052994ed
replace TestBackup with pkg/backup.Builder ( #1593 )
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-06-21 17:08:08 -04:00
Steve Kriss
0d326a3903
remove unused hasControllerOwner func and tests
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-06-21 11:44:13 -06:00
Steve Kriss
d421fcd85c
initial structure for refactored pkg/restore tests
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-06-21 09:15:18 -06:00
Anshul Chandra
4e12b08953
Validate restore name label length
...
Velero should handle cases when the label length exceeds 63 characters.
- if the length of the backup/restore name is <= 63 characters, use it as the value of the label
- if it's > 63 characters, take the SHA256 hash of the name. the value of
the label will be the first 57 characters of the backup/restore name
plus the first six characters of the SHA256 hash.
Fixes heptio#1021
Signed-off-by: Anshul Chandra <anshulc@vmware.com >
2019-05-01 10:25:11 -07:00
Steve Kriss and KubeKween
3155bb159f
remove VolumeBackupInfo from API pkg ( #1388 )
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-04-24 13:16:03 -07:00
Steve Kriss
5bc6695109
move RestoreResult from api to pkg/restore, rename to Result
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-04-16 12:57:02 -06:00
Steve Kriss
c59544cb79
remove backup.status.volumeBackups and all related code
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-04-15 10:17:40 -06:00
Steve Kriss
892673816b
remove legacy restore label
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-04-15 10:17:03 -06:00
Steve Kriss
77e648eafa
remove Ark field from RestoreResult
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-04-15 10:17:02 -06:00
sseago and Steve Kriss
a519547efc
Adds support for allowing a RestoreItemAction to skip item restore ( #1336 )
...
* Adds support for allowing a RestoreItemAction to skip item restore
This allows a RestoreItemAction plugin to signal to velero that
the returned item should be skipped rather than restored to the
cluster.
To support this, a boolean SkipRestore attribute is added to
RestoreItemActionExecuteOutput. If restore.restoreResource finds
this set to true, any remaining actions on this item are skipped,
and restore on this item is skipped. Execution continues with
the next item of this resource type.
To signal this for a particular item, the RestoreItemAction's
Execute method should call WithoutRestore() on the
RestoreItemActionExecuteOutput before returning it.
Signed-off-by: Scott Seago <sseago@redhat.com >
* Autogenerated code to support SkipRestore
Signed-off-by: Scott Seago <sseago@redhat.com >
* Added changelog for #1336
Signed-off-by: Scott Seago <sseago@redhat.com >
2019-04-04 13:39:54 -06:00
Steve Kriss and Nolan Brubaker
7298a4eda0
allow restic restore helper image to be specified via ConfigMap ( #1311 )
...
* allow restic restore helper image to be specified via ConfigMap
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-03-29 17:11:34 -04:00
Steve Kriss and KubeKween
a696cd09f2
remove Warning from restore item action output ( #1318 )
...
Signed-off-by: Steve Kriss <krisss@vmware.com >
2019-03-28 13:08:37 -07:00
9b635c0e14
add additionalItems to restore item actions ( #1304 )
...
* add additionalItems to restore item actions
Signed-off-by: Steve Kriss <krisss@vmware.com >
Co-authored-by: Andy Goldstein <goldsteina@vmware.com >
2019-03-28 12:21:56 -07:00