Commit Graph

772 Commits (2dce4a7cb5954c9f7987e56cebbe54834ce41271)

Author SHA1 Message Date
Ming 752b28166f Merge branch 'main' of https://github.com/qiuming-best/velero into restic-repo-tmp 2022-05-06 14:43:00 +08:00
Scott Seago da916846b1 continue rather than return for non-matching restore action label
When iterating over applicable restore actions, if a non-matching label
selector is found, velero should continue to the next action rather than
returning from the restoreItem func, which ends up preventing the item's
restore entirely.

Signed-off-by: Scott Seago <sseago@redhat.com>
2022-05-05 08:37:48 -04:00
Xun Jiang a69bd8b1f3 Remove VolumeSnapshot created during backup, when the VolumeSnapshotClass's DeletionPolicy is set to Delete.
1. Delete VolumeSnapshot directly when DeletionPolicy set to Retain.
2. Change VolumeSnapshotContent's DeletionPolicy to Retain, then delete VolumeSnapshot. After that delete VolumeSnapshotContent and change VSC DeletionPolicy to Delete back, then re-create the VolumeSnapshotContent.

Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-05-05 18:30:59 +08:00
Xun Jiang 6421f8ad02 Make waiting VolumeSnapshot to ready process parallel.
Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-05-05 14:32:55 +08:00
Wenkai Yin(尹文开) aa71427576
Merge pull request #4887 from reasonerjt/delete-orphan-vs
Delete orphan CSI snapshots in backup sync controller
2022-05-05 11:27:44 +08:00
Daniel Jiang 89e90d9be4 Delete orphan CSI snapshots in backup sync controller
This commit makes backup sync controller delete the volumesnapshot and
volumesnapshotcontent created by the backup which is cleaned up as orphan

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-05-05 10:54:34 +08:00
Daniel Jiang 628164668f
Merge pull request #4655 from ywk253100/220214_pod_volume_restore
Convert Pod Volume Restore resource/controller to the Kubebuilder framework
2022-05-05 10:33:41 +08:00
Ming 06d3d731ed Refactor restic repository
Signed-off-by: Ming <mqiu@vmware.com>
2022-04-29 10:26:00 +08:00
Xun Jiang/Bruce Jiang 001229a8b3
Merge pull request #4855 from reasonerjt/bak-delete-refact
Refactor backup deletion controller based on kubebuilder
2022-04-28 10:48:11 +08:00
Wenkai Yin(尹文开) d42e353610
Merge pull request #4866 from reasonerjt/clusterclass-restore-order
Add ClusterClasses to the restore priority list
2022-04-28 09:04:41 +08:00
Scott Seago 58a8371ca2
Merge pull request #4833 from ywk253100/220413_restart
Make in-progress backup/restore as failed when doing the reconcile
2022-04-27 11:45:01 -04:00
Daniel Jiang 74fd158a1c Refactor backup deletion controller based on kubebuilder
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-04-27 17:00:54 +08:00
Daniel Jiang f89691c5c1 Add ClusterClasses to the restore priority list
Make sure ClusterClasses are stored before Clusters.
Fixes #4767

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-04-27 15:53:55 +08:00
Wenkai Yin(尹文开) c2c211fefb Convert Pod Volume Restore resource/controller to the Kubebuilder framework
Convert Pod Volume Restore resource/controller to the Kubebuilder framework

Fixes #4134

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-04-26 16:23:38 +08:00
Wenkai Yin(尹文开) dfc86566b8 Make in-progress backup/restore as failed when doing the reconcile
Make in-progress backup/restore as failed when doing the reconcile to avoid hanging in in-progress status

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-04-26 11:05:03 +08:00
Xun Jiang 22dd0b2ebb Modify CSI VolumeSnapshot metric related code.
Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-04-23 12:59:56 +08:00
Daniel Jiang 3ec96e2eac
Merge pull request #4838 from ywk253100/220418_marker
Use controller-gen to generate the deep copy methods for objects
2022-04-21 14:00:48 +08:00
Wenkai Yin(尹文开) 9e786d681b
Merge pull request #4832 from reasonerjt/fix-rm-csi-bak-tmp
Make the vsc created by backup sync controller deletable
2022-04-20 17:19:09 +08:00
Scott Seago de17605c62
Merge pull request #4769 from jibutech/4754-fix
Skip povdolumerestore creation when restore excludes pv/pvc
2022-04-19 11:54:30 -04:00
Daniel Jiang 4f9e445142 Make the vsc created by backup sync controller deletable
Fixes #4760

This commit make changes in 2 parts:
1) When a volumesnapshotcontent is persisted during backup, velero will reset its
   `Source` field to remove the VolumeHandle, so that the
   csi-snapshotter will not try to call `CreateSnapshot` when its synced
   to another cluster with a backup.
2) Make sure the referenced volumesnapshotclasses are persisted and
   synced with the backup, so that when the volumesnapshotcontent is
   deleted the storage snapshot is also removed.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-04-19 15:06:59 +08:00
Xun Jiang 8064421e83 Update integrated Restic version and add insecureSkipTLSVerify for Restic CLI
1. Add --insecure-tls for ResticManager's commands.
2. Add --insecure-tls in PodVolumeBackup and PodVolumeRestore controller.
3. Upgrade integrated Restic version to v0.13.1
4. Change --last flag in Restic command to --latest=1 due to Restic version update.

Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-04-18 21:29:33 +08:00
Wenkai Yin(尹文开) 28bc8b7eef Use controller-gen to generate the deep copy methods for objects
As we are refactoring controllers with kubebuilder, use the controller-gen rather than code-generator to generate the deep copy methods for objects

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-04-18 21:18:00 +08:00
qiuming 9373c8a383
Merge pull request #4818 from blackpiglet/2499-add-metric-for-csi-snapshot
Add CSI VolumeSnapshot related metrics.
2022-04-15 16:55:37 +08:00
Xun Jiang/Bruce Jiang 22189e8e19
Merge pull request #4436 from codegold79/3454-convert-pod-volume-backup-controller-to-kubebuilder-v3-framework
Convert Pod Volume Backup resource/controller to the Kubebuilder V3 framework
2022-04-15 15:07:09 +08:00
Xun Jiang/Bruce Jiang dcc7b939a4
Merge pull request #4817 from yuvalman/deleteEmptyBackup
fix: delete empty backups
2022-04-15 14:32:44 +08:00
Wenkai Yin(尹文开) 8ddbe5120e
Merge pull request #4831 from qiuming-best/fix-ttl
Fix default-backup-ttl not work
2022-04-15 14:30:37 +08:00
Xun Jiang/Bruce Jiang c115a37b27
Merge pull request #4797 from blackpiglet/4758-avoid-duplicate-snapshot-for-csi
Avoid duplicated snapshotting, when CSI is enabled
2022-04-14 19:49:34 +08:00
Ming c17172f4ef Fix default-backup-ttl not work
Signed-off-by: Ming <mqiu@vmware.com>
2022-04-14 15:11:44 +08:00
I538157 74db20993b fix: delete empty backups
Signed-off-by: Yuval Manor <yuvalman958@gmail.com>
2022-04-12 13:13:56 +03:00
Xun Jiang 4daeec7ab9 Update CRD and GRPC.
Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-04-09 12:35:09 +00:00
Xun Jiang 5c74aa22e6 Avoid duplicated snapshotting, when CSI is enabled
Fix #4758

Do not take snapshot for PV to avoid duplicated snapshotting, when CSI feature is enabled.

Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-04-07 23:32:48 +08:00
Wenkai Yin(尹文开) 016ac129c6 Refactor schedule controller with kubebuilder
Refactor schedule controller with kubebuilder

fixes #4671

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-04-07 17:32:52 +08:00
Daniel Jiang 7c40949992
Merge pull request #4800 from reasonerjt/bump-up-csi-to-v1
Bump up to v1 API for CSI snapshot
2022-04-01 13:46:00 +08:00
Daniel Jiang 04f59ce003 Bump up to v1 API for CSI snapshot
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-03-31 22:55:03 +08:00
half-life666 e24c8845c4 Skip podvolumerestore creation when restore excludes pv/pvc
Signed-off-by: half-life666 <half-life@jibudata.com>
2022-03-31 09:27:33 +08:00
qiuming cdb346f7fd
Merge pull request #4778 from blackpiglet/add-kibishii-direcotry-parameter-for-e2e
Add parameter for e2e test to support modify kibishii install path.
2022-03-29 17:24:35 +08:00
Wenkai Yin(尹文开) 0b8f19e4d4
Merge pull request #4779 from reasonerjt/fix-restore-hook
Ensure the restore hook applied to new namespace based on the mapping
2022-03-29 14:07:08 +08:00
Daniel Jiang 2939914113 Ensure the restore hook applied to new namespace based on the mapping
fixes #4720

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-03-28 10:24:47 +08:00
Xun Jiang fa646888ef Add parameter for e2e test to support modify kibishii install path.
Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-03-27 20:33:26 +08:00
Scott Seago 8e4f88db68
Merge pull request #4295 from mercedes-benz/tobiasgiese/items-metrics
Add metrics backup_items_total and backup_items_errors
2022-03-25 16:40:43 -04:00
Tiger Kaovilai d1fdaecc94
Add labels to expired backups failing garbage collection. (#4757)
* Add bsl related TTL gc errors to labelSelectors
* if backup label map is nil, make map
* clear label if not BSL error

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
2022-03-25 17:01:55 +08:00
Tobias Giese 1b8da68fc2 metrics: add items gauges
Signed-off-by: Tobias Giese <tobias.giese@daimler.com>
2022-03-22 18:36:55 +01:00
Xun Jiang/Bruce Jiang 9df0394359
Merge pull request #4740 from phuongatemc/add-priorityclass-to-podaction-plugin
Add priorityclass to podaction plugin
2022-03-22 19:43:04 +08:00
Scott Seago 09ec3ba994
Insert all restore errors and warnings into restore log (#4743)
This allows a user inspecting the restore logs to see any
errors or warnings generated by the restore so that they
will be seen even without having to use the describe cli.

Signed-off-by: Scott Seago <sseago@redhat.com>
2022-03-21 14:29:03 +08:00
Hoang, Phuong e9d5f7121c Add unit tests, change copyright years and revert unrelated changes.
Signed-off-by: Hoang, Phuong <phuong.n.hoang@dell.com>
2022-03-15 19:51:53 -04:00
Hoang, Phuong d2ef5cbe0a Add changelog
Signed-off-by: Hoang, Phuong <phuong.n.hoang@dell.com>
2022-03-15 19:05:13 -04:00
Xun Jiang 291f0c17e8 Support multiple skip option for E2E test
The GINKGO_SKIP option is updated to string that can be separated by "." for "make test-e2e".

Signed-off-by: Xun Jiang <jxun@vmware.com>
Signed-off-by: Hoang, Phuong <phuong.n.hoang@dell.com>
2022-03-15 19:05:13 -04:00
qiuming 3c49ec4fb4
Merge pull request #4725 from blackpiglet/4725-support-multiple-skip
Support multiple skip option for E2E test
2022-03-08 19:43:28 +08:00
Xun Jiang d694d40919 Support multiple skip option for E2E test
The GINKGO_SKIP option is updated to string that can be separated by "." for "make test-e2e".

Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-03-08 17:04:32 +08:00
Wenkai Yin(尹文开) 208d250ddc
Merge pull request #4719 from ywk253100/220225_bsl
Update BSL CR as long as there is any error
2022-03-08 16:40:24 +08:00
Wenkai Yin(尹文开) bcc9aa8d69 Update BSL CR as long as there is any error
1. Mark the BSL as "Unavailable" when gets any error
2. Add a new field "Message" to the BSL status to record the error message

Fixes #4485
Fixes #4405

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-03-07 10:25:18 +08:00
qiuming 79037848c8
Merge pull request #4623 from blackpiglet/push-image-in-github-workflow
Add pushing image to GCR in github workflow
2022-03-01 15:52:45 +08:00
qiuming b0cd90253b
Merge pull request #4661 from blackpiglet/4499-hook-podexec-container
[fix] Avoid overwritten hook's exec.container parameter when running …
2022-03-01 15:39:54 +08:00
Wenkai Yin(尹文开) 7d48e030fa
Merge pull request #4704 from reasonerjt/enable-coverage
Enable coverage in test.sh and upload to codecov
2022-02-28 15:26:28 +08:00
Daniel Jiang 9f46b10b70 Enable coverage in test.sh and upload to codecov
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-02-28 10:59:49 +08:00
Wenkai Yin(尹文开) 8aaeed4411
Merge pull request #4686 from reasonerjt/fix-4080
Bypass the remap CRD version plugin when v1beta1 CRD is not supported
2022-02-28 10:57:52 +08:00
Daniel Jiang 1cf61dd1aa
Merge pull request #4084 from MatthieuFin/main
Add full support for setting securityContext for restic restore
2022-02-24 20:18:09 +08:00
James Landrein 77be862b9c
Add support for --pod-labels (#4694)
* Add support for --pod-labels
* Add changelog

Signed-off-by: James Landrein <github@j4m3s.eu>
2022-02-24 17:00:14 +08:00
Daniel Jiang ea38f84c53
Merge pull request #4660 from blackpiglet/update-onwer-references-in-backup-descrip
Update --use-owner-references-in-backup description in velero command…
2022-02-24 15:47:34 +08:00
qiuming 17043cd5cd
Merge pull request #4518 from ywk253100/220112_restic_prune
Fix bug to make the restic prune frequency configurable
2022-02-24 14:20:34 +08:00
MatthieuFin f6bdfd09c5 Merge remote-tracking branch 'upstream/main'
Signed-off-by: MatthieuFin <matthieu2717@gmail.com>
2022-02-23 15:03:15 +01:00
Xun Jiang 9cb81d825e Add skip case support in e2e test
Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-02-23 14:05:22 +08:00
Daniel Jiang 0070138c62 Bypass the remap CRD version plugin when v1beta1 CRD is not supported
When velero is running on clusters that don't support v1beta1 CRD, the
plugin will not try to backup v1beta1 CRD.
The plugin should be kept for backward compatibility.  It will be
removed when velero drop the support for k8s v1.21

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-02-22 18:59:47 +08:00
Xun Jiang 8c2a07b906 Update --use-owner-references-in-backup description in velero command line
Specify the risk of this parameter set to true. Add the issue first reported about this topic which includeds the google document illustrates about it.

Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-02-21 22:37:48 +08:00
Xun Jiang 7be12a9220 [fix] Add regional PV support for GKE
fix #4663.
For GKE pv, when create backup, return all zones retrived from node affinity.

Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-02-21 22:04:21 +08:00
Xun Jiang 6d9004dc62 [fix] Avoid overwritten hook's exec.container parameter when running pod command executor
Fix #4499
When hook influnce multiple pods, current logic's first pod's container will overwrite the hook's exec.container parameter. That will cause the other pod fail on the hook executing.

Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-02-17 15:24:56 +08:00
Daniel Jiang e4292965da
Merge pull request #4656 from a-mccarthy/release-notes-edits
Copy edits for 1.8 release notes
2022-02-17 10:05:58 +08:00
Daniel Jiang 3db8798525
Merge pull request #4658 from dsu-igeek/dsu-changelog-1.8-update
Updates to 1.8 changelog
2022-02-17 10:00:01 +08:00
David L. Smith-Uchida 926f40170d Updates to 1.8 changelog
Signed-off-by: David L. Smith-Uchida <dave@kasten.io>
2022-02-16 10:30:16 -08:00
Abigail McCarthy bdcb6d3e98 Copy edits for 1.8 release notes
Signed-off-by: Abigail McCarthy <mabigail@vmware.com>
2022-02-16 11:53:09 -05:00
Daniel Jiang b9d4fe86cf
Merge pull request #4654 from ywk253100/220216_release_note
Update release note to reflect the fix for #1980
2022-02-16 14:11:46 +08:00
Wenkai Yin(尹文开) 9fd241a1a0 Update release note to reflect the fix for #1980
Update release note to reflect the fix for #1980

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-02-16 08:27:44 +08:00
bynare 768a30618f
restic backupper: ignore volumes of non-running pods (#4584) 2022-02-16 05:34:58 +08:00
frankly_coding 5ca5b884c1
Merge branch '1.8-release-note' into 1.8-release-note 2022-02-15 10:56:31 -08:00
F. Gold e3685786fa
Add delete BSL cleanup highlight and fixed grammar in heading
Signed-off-by: F. Gold <fgold@vmware.com>
2022-02-15 10:53:46 -08:00
Daniel Jiang 70d12ea16e Refine the release note of v1.8
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-02-15 22:55:12 +08:00
Xun Jiang 9419aa91a7 Update e2e test image to gcr.io
By now, only busybox:latest is used by e2e. It is already upload to gcr.io/velero-gcp/busybox:latest
Change the image to gcr.io to avoid pulling rate limitation from docker hub.

Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-02-14 20:55:34 +08:00
Ming 6a61a418ca Fix E2E backup namespaces test
Signed-off-by: Ming <mqiu@vmware.com>
2022-02-14 17:41:28 +08:00
Xun Jiang 5844fca5af Add pushing image to GCR in github workflow
Push to GCR in github workflow to faciliate some environments that have rate limitation to docker hub, e.g. vSphere.
 <root@jxun-jumpserver.c.velero-gcp.internal>
Signed-off-by: Xun Jiang <jxun@vmware.com>
2022-02-09 16:27:25 +08:00
F. Gold 9b9aa3f308
Add changelog for PR 4436
Signed-off-by: F. Gold <fgold@vmware.com>
2022-02-07 11:41:15 -08:00
Dominic Brekau 5fa7d08fa1
Use OrderedResources in schedules (#4550)
* Use OrderedResources in schedules
Make ParseOrderedResources public for use in schedules
Add changelog

Signed-off-by: Dominic <dominic@xdnx.org>

* Rename function in comment section

Signed-off-by: Dominic <dominic@xdnx.org>
2022-01-29 15:47:55 +08:00
Ming e4046017db E2E SSR test add retry mechanism and logs
Signed-off-by: Ming <mqiu@vmware.com>
2022-01-28 18:51:46 +08:00
Daniel Jiang 2cbb881285
Merge pull request #4497 from dkeven/filterunmountedvol
Fix: skip not mounted volumes when backing up
2022-01-24 14:40:18 +08:00
Ming caa80db92c Add E2E test of backups sync from BSL
Signed-off-by: Ming <mqiu@vmware.com>
2022-01-19 15:09:02 +08:00
dkeven 1e44edce67 Fix: skip not mounted volumes when backing up
Signed-off-by: dkeven <keven@kubesphere.io>
2022-01-18 17:53:01 +08:00
Daniel Jiang 459365013c
Update changelog for v1.8.0 (#4530)
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-01-14 09:20:53 -05:00
Daniel Jiang 7a5ae101e6 Update doc for v1.8
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-01-14 01:12:10 +08:00
qiuming 595e62ee7e
Merge pull request #4521 from qiuming-best/ssr-test
E2E test on ssr object with controller namespace mix-ups
2022-01-13 14:31:56 +08:00
Ming f36161eeee E2E test on ssr object with controller namespace mix-ups
Signed-off-by: Ming <mqiu@vmware.com>
2022-01-13 14:10:37 +08:00
Wenkai Yin(尹文开) fcad46ccdf Check whether the volume is provisioned by CSI driver or not by the annotation as well
Check whether the volume is provisioned by CSI driver or not by the annotation as well

Fixes #4496

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-01-12 19:05:33 +08:00
Wenkai Yin(尹文开) fb2722ffe5 Fix bug to make the restic prune frequency configurable
We introduces the installation option "--default-restic-prune-frequency" to make restic prune frequency configuration in the previous release, but there is a bug that make the option don't take effect. This commit fixes the bug by removing the evaluation part. The restic repository controller will take care the prune frequency for the repository

Fixes #3062

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-01-12 15:18:24 +08:00
Wenkai Yin(尹文开) 6c1f16a735 Initialize the labels field of `velero backup-location create` option
Initialize the labels field of `velero backup-location create` option to avoid #4484

Fixes #4484

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-01-06 10:35:39 +08:00
Ming 97b106d1a3 Fix e2e 2500 namespaces scale test timeout problem
Signed-off-by: Ming <mqiu@vmware.com>
2022-01-04 15:24:14 +08:00
Wenkai Yin(尹文开) 3feb259235
Merge pull request #4401 from danfengliu/add-backup-deletion-e2e-test-to-main
Add backup deletion e2e test
2021-12-24 16:04:08 +08:00
danfengl 29b2cd1883 Add backup deletion e2e test
Test case description is "Deleted backups are deleted from object storage and backups deleted from object storage can be deleted locally",
in this test, only resource backup objects are target for verifition, restic repo verification is not included in this PR, and snapshot verification will be in later PR

Signed-off-by: danfengl <danfengl@vmware.com>
2021-12-23 12:45:31 +00:00
Wenkai Yin(尹文开) 72fc1d2c0b
Parse resource from backup tarball directly rather than resolving it via discovery service to avoid #4009 (#4398) 2021-12-21 19:28:55 +08:00
qiuming 6be36c2aa4
Merge pull request #4455 from qiuming-best/rbac-test
Add rbac and annotation test cases
2021-12-21 16:12:20 +08:00
Daniel Jiang 7c2dc143d5
Merge pull request #4391 from ywk253100/211123_anno
Keep the annotation "pv.kubernetes.io/provisioned-by" when restoring PVs
2021-12-21 11:08:25 +08:00
Wenkai Yin(尹文开) 648f3ac228 Keep the annotation "pv.kubernetes.io/provisioned-by" when restoring PVs
More details please refer to https://github.com/vmware-tanzu/velero/issues/3470#issuecomment-976279606

Fixes #3470

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-12-21 09:52:56 +08:00
Wenkai Yin(尹文开) c7cd95a374
Ignore the provided port is already allocated error when restoring the LoadBalancer service (#4462)
Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-12-21 05:42:27 +08:00
Daniel Jiang d7aa82d8ed
Return the error when getting backup store in backup deletion controller (#4465)
Per discussion in
https://github.com/vmware-tanzu/velero/issues/4260#issuecomment-947721686
https://github.com/vmware-tanzu/velero/issues/4260#issuecomment-951347384

return the error to avoid a panic when downloading the backup tarball

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-12-21 05:38:13 +08:00
Xun Jiang bdde7585c8 Add changelog.
Signed-off-by: Xun Jiang <jxun@vmware.com>
2021-12-17 16:16:03 +08:00
Xun Jiang 7ab4bfc632 Revert "Migrate backup sync controller from code-generator to kubebuilder (#4423)"
This reverts commit 5aaeb3ebbe.
2021-12-17 09:40:24 +08:00
Ming be752dd8d9 Add rbac and annotation test cases
Signed-off-by: Ming <mqiu@vmware.com>
2021-12-16 18:02:24 +08:00
Box-Cube 69f6c8d0cd
Fix statefulsets volumeClaimTemplates storageClassName after use Changing PV/PVC Storage Classes (#4375)
* fix statefulsets volumeClaimTemplates storageClassName after use Changing PV/PVC Storage Classes

Signed-off-by: Box-Cube <64300761+Box-Cube@users.noreply.github.com>

* Fix (vmware-tanzu#4373)

Signed-off-by: Box-Cube <64300761+Box-Cube@users.noreply.github.com>

* Fix StatefulSet volumeClaimTemplates storageClassName(vmware-tanzu#4373)

Signed-off-by: Box-Cube <64300761+Box-Cube@users.noreply.github.com>

* Fix StatefulSet volumeClaimTemplates storageClassName(vmware-tanzu#4373)

Signed-off-by: Box-Cube <64300761+Box-Cube@users.noreply.github.com>

* Fix StatefulSet volumeClaimTemplates storageClassName(vmware-tanzu#4373)

Signed-off-by: Box-Cube <64300761+Box-Cube@users.noreply.github.com>

* Change the isStorageClassExist logic

Signed-off-by: Box-Cube <64300761+Box-Cube@users.noreply.github.com>

* Fix StatefulSet volumeClaimTemplates storageClassName(vmware-tanzu#4373)

Signed-off-by: Box-Cube <64300761+Box-Cube@users.noreply.github.com>
2021-12-16 14:50:56 +08:00
qiuming e350ce5bb4
Merge pull request #4440 from qiuming-best/upgrade-e2e-vsphere-plugin
Upgrade e2e test vsphere plugin
2021-12-16 09:45:06 +08:00
Ming d8b1ed7dba Upgrade e2e test vsphere plugin
Signed-off-by: Ming <mqiu@vmware.com>
2021-12-15 17:44:57 +08:00
Xun Jiang/Bruce Jiang 5aaeb3ebbe
Migrate backup sync controller from code-generator to kubebuilder (#4423)
* Migrate backup sync controller from code-generator to kubebuilder

1. use kubebuilder's reconcile logic to replace controller's old logic.
2. use ginkgo and gomega to replace testing.

Signed-off-by: Xun Jiang <jxun@vmware.com>

* Fix: modify code according to comments

1. Remove DefaultBackupLocation
2. Remove unneccessary comment line
3. Add syncPeriod default value setting logic
4. Modify ListBackupStorageLocations function's context parameter
5. Add RequeueAfter parameter in Reconcile function return value

Signed-off-by: Xun Jiang <jxun@vmware.com>

* Reconcile function use context passed from parameter

1. Use context passed from parameter, instead of using Reconciler struct's context.
2. Delete Reconciler struct's context member.
3. Modify test case accordingly.

Signed-off-by: Xun Jiang <jxun@vmware.com>
2021-12-14 20:07:20 -05:00
Frangipani Gold d3c7ef09cb
Remove backups and restic repos associated with deleted BSL(s) (#4377)
* Remove backups and restic repos associated with deleted BSL(s)

Signed-off-by: F. Gold <fgold@vmware.com>

* add changelog

Signed-off-by: F. Gold <fgold@vmware.com>

* Add PR number to changelog

Signed-off-by: F. Gold <fgold@vmware.com>

* Fix typo

Signed-off-by: F. Gold <fgold@vmware.com>

* Only delete backups and restic repos and report success when without errors

Signed-off-by: F. Gold <fgold@vmware.com>
2021-12-13 16:09:24 -08:00
David L. Smith-Uchida a1b48ceac5
Adds <backup-name>-itemsnapshots.gz file to backup (when provided). (#4429)
* Adds <backup-name>-itemsnapshots.gz file to backup (when provided).  Also
adds DownloadTargetKindBackupItemSnapshots type to allow downloading.
Updated object store unit test

Fixes #3758

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* Removed redundant checks

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>
2021-12-13 14:47:50 -05:00
Xun Jiang 706d142096 fix: remove --crds-version in velero install command
Due to only v1 CRD is supported in velero version 1.8, remove CRDs version choosing option.

Signed-off-by: Xun Jiang <jxun@vmware.com>
2021-12-13 21:02:56 +08:00
David L. Smith-Uchida 5677e04bb1
Consolidated code for resolving actions and plugins into ActionResolver (#4410)
* Consolidated code for resolving actions and plugins into ActionResolver.  Added BackupWithResolvers and
RestoreWithResolvers.  Introduces ItemSnapshooterResolver to bring ItemSnapshotter plugins into backup and
restore.  ItemSnapshotters are not used yet.

Added action_resolver_test

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* Addressed review comments

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>
2021-12-10 12:53:47 -05:00
ming qiu d1e2c7b476 Fix e2e test failures for the inappropriate optimaze of velero install
Signed-off-by: ming qiu <mqiu@mqiu-a01.vmware.com>
2021-12-10 11:10:51 +08:00
ming qiu c58fc1445e Limit backup namespaces on test resource filtering cases
Signed-off-by: ming qiu <mqiu@mqiu-a01.vmware.com>
2021-12-09 11:48:32 +08:00
Wenkai Yin(尹文开) 769af3f7b8
Merge pull request #4416 from dsu-igeek/dsu-upload-progress-feature-flag-12-01-2021
Added UploadProgressFeature flag to enable UploadProgressMonitoring
2021-12-08 09:33:36 +08:00
Dave Smith-Uchida d0e660f435 Added UploadProgressFeature flag to enable UploadProgressMonitoring and ItemSnapshotters
Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>
2021-12-07 00:06:36 -08:00
Scott Seago d9f8abcd27
Merge pull request #4431 from reasonerjt/bump-up-go-1.17
Bump up Go to 1.17
2021-12-06 11:48:16 -05:00
Daniel Jiang a3d196ee85 Bump up Go to 1.17
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-12-06 20:16:24 +08:00
qiuming ebccca0f1b
Merge pull request #4404 from qiuming-best/resource-filtering
Add resource filtering test cases
2021-12-06 15:02:53 +08:00
Ming 0c8063cfd2 Add resoure filtering test cases
Signed-off-by: Ming <mqiu@vmware.com>
2021-12-04 22:47:46 +08:00
Wenkai Yin(尹文开) 74e9c43514
Merge pull request #4397 from reasonerjt/fix-3516
Add restoreactionitem plugin to handle admission webhook configurations
2021-12-01 14:13:16 +08:00
Daniel Jiang 2a7d4cec6e Add restoreactionitem plugin to handle admission webhook configurations
This commit adds a restore action item plugin to reset invalid value
of "sideEffects" in resource of mutatingwebhookconfiguration and
validating webhookconfiguration.

To fix the problem the "sideEffects" is illegal for resource migrated
from v1beta1.

fixes #3516

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-12-01 00:48:06 +08:00
Aditya Sharma 47aa093a16
Build for darwin_arm64 (#4409)
Signed-off-by: Aditya Sharma <git@adi.run>
2021-11-30 11:27:29 -05:00
Daniel Jiang 02013ef335
Merge pull request #4382 from blackpiglet/4369-bsl-from-kubebuilder-v2-to-v3
feat: migrate velero controller from kubebuilder v2 to v3
2021-11-24 09:35:39 +08:00
Xun Jiang 303d3dcad3 feat: migrate kubebuilder from v2 to v3
1. remove config/crd/v1beta1
2. remove PROJECT file
3. update controller-gen and kubebuilder version
4. generate client and CRD file
5. add changelog and remove v1beta1 CRD generated code.
6. add kubebuilder test bundle setup command.
7. due to apiextensions.k8s.io/v1beta1 is not supported, only k8s after v1.16 is supported, so remove v1.15 check.
8. add CRD and k8s suppored version update in changelog.

Signed-off-by: Xun Jiang <jxun@vmware.com>
2021-11-23 19:32:19 +08:00
ming qiu 58325050ec Adjust structure of e2e test codes
Put every test moduels into seperate packages and all velero install parameters integrated into one struct

Signed-off-by: Ming <mqiu@vmware.com>
2021-11-22 15:57:58 +08:00
Wenkai Yin(尹文开) 474fd61283
Merge pull request #4376 from reasonerjt/pv-zone-gcp
Add the key for GKE zone for AZ collection
2021-11-22 10:14:04 +08:00
Daniel Jiang 748cf86aa7 Add the key for GKE zone for AZ collection
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-11-20 15:58:31 +08:00
danfengl e09837cc4c Fix snapshot e2e test issue of jsonpath
Signed-off-by: danfengl <danfengl@vmware.com>
2021-11-18 08:54:57 +00:00
Wenkai Yin(尹文开) 11abff4e8d
Merge pull request #4341 from blackpiglet/3737-add-logger-for-crd-manager
Fix: add init log option for velero controller-runtime manager.
2021-11-18 13:56:14 +08:00
Xun Jiang/Bruce Jiang fc29294552
fix: modify generated from schedule's backup name timestamp to UTC ti… (#4353)
* fix: modify generated from schedule's backup name timestamp to UTC timezone

fix #4279
When backup is created from schedule, and the backup name is not specified, a containing-timestamp generated name will be used. Due to velero client not set timezone to UTC, a local timezone will be used for the generated name.

Signed-off-by: Xun Jiang <jxun@vmware.com>

* fix: modify generated from schedule's backup name timestamp to UTC timezone

fix #4279
When backup is created from schedule, and the backup name is not specified, a containing-timestamp generated name will be used. Due to velero client not set timezone to UTC, a local timezone will be used for the generated name.

Signed-off-by: Xun Jiang <jxun@vmware.com>

* fix: modify generated from schedule's backup name timestamp to UTC timezone

fix #4279
When backup is created from schedule, and the backup name is not specified, a containing-timestamp generated name will be used. Due to velero client not set timezone to UTC, a local timezone will be used for the generated name.

Signed-off-by: Xun Jiang <jxun@vmware.com>

* modify changelog description

Reword the changelog description according to comments.

Signed-off-by: Xun Jiang <jxun@vmware.com>

Co-authored-by: jxun <jxun@jxun-a01.vmware.com>
Co-authored-by: Xun Jiang <jxun@vmware.com>
2021-11-17 09:26:49 -05:00
David L. Smith-Uchida 5150ce4891
ItemSnapshotter plugin APIs. Addresses #3753 (#4077)
Added ItemSnapshotter.proto
Added item_snapshotter Go interface
Added framework components for item_snapshotter
Updated plugins doc with ItemSnapshotter info
Added SnapshotPhase to item_snapshotter.go
ProgressOutputOutput now includes a phase as well as an error string for problems that occured

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>
2021-11-16 16:13:31 -05:00
Scott Seago 3aa204a30d
Merge pull request #4350 from reasonerjt/read-pv-az-new
Read Availability zone from nodeAffinity requirements
2021-11-16 08:43:27 -05:00
Xun Jiang 8eee35a62e Fix: add init log option for velero controller-runtime manager.
fix for issue #3737
add log option for velero controller-runtime manager to log return error in reconcile loop.

Signed-off-by: Xun Jiang jxun@vmware.com
Signed-off-by: Xun Jiang <jxun@vmware.com>
2021-11-16 15:42:00 +08:00
Xun Jiang 7b89950031 Fix: add init log option for velero controller-runtime manager.
fix for issue #3737
add log option for velero controller-runtime manager to log return error in reconcile loop.

Signed-off-by: Xun Jiang jxun@vmware.com
Signed-off-by: Xun Jiang <jxun@vmware.com>
2021-11-16 15:37:43 +08:00
Daniel Jiang 5878a52843 Read Availability zone from nodeAffinity requirements
Velero to read the AZ info from `NodeAffinity` of a PV when it's taking
the snapshot.

Fixes #4332

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-11-16 09:44:12 +08:00
Bruce 71d482360f
Use factory.Namespace() to replace hardcoded velero namespace (#4346)
* Use factory.Namespace() to replace hardcoded velero namespace

Signed-off-by: half-life666 <half-life@jibudata.com>

* Add change log for pr 4346

Signed-off-by: half-life666 <half-life@jibudata.com>
2021-11-15 20:36:29 -05:00
Wenkai Yin(尹文开) 7c4e03e9f9
Ignore the `provided port is already allocated` error when restoring the `NodePort` service (#4336)
Fixes #2308

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-11-15 20:25:04 +08:00
Daniel Jiang 130602d723
Return the error if velero failed to detect S3 region for restic repo (#4343)
The error should be returned explicitly, because when the default URL is
used S3 will return a 301 and the response can't be handled by restic.

Fixes #4178

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-11-15 20:20:27 +08:00
Scott Seago 983489073f
PV remapClaimRefNS was being skipped when there was no snapshot (#3708)
Signed-off-by: Scott Seago <sseago@redhat.com>
2021-11-09 20:30:16 -05:00
Bridget McErlean e4019f26c1
Only set BSL credential field if provided (#4322)
Previously, the BSL credential field would always be set when using the
`create` command, even if no credential details were provided. This
would result in an empty `SecretKeySelector` in the BSL which would
cause operations using this BSL to fail as Velero would attempt to fetch
a `Secret` with an empty name from the K8s API server.

With this change, the `Credential` field is only set if credential
details have been specified. This change also includes some refactoring
to allow the change to be tested.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-11-09 17:04:58 -08:00
Wenkai Yin(尹文开) 6801ddc9ac
Merge pull request #4306 from alaypatel07/fix-paging
fix buggy pager func
2021-11-10 07:53:58 +08:00
Alay Patel 569fc1dc5b add 4306 changelog
Signed-off-by: Alay Patel <alay1431@gmail.com>
2021-11-09 10:34:26 -05:00
Scott Seago 550efddd88
Verify group before treating resource as cohabitating (#4126)
Signed-off-by: Scott Seago <sseago@redhat.com>
2021-11-03 18:11:32 -04:00
Wenkai Yin(尹文开) 9f0ea22c60
Fix CVE-2020-29652 and CVE-2020-26160 (#4274)
Bump up restic to v0.12.1 to fix CVE-2020-26160.
Bump up module "github.com/vmware-tanzu/crash-diagnostics" to v0.3.7 to fix CVE-2020-29652.
The "github.com/vmware-tanzu/crash-diagnostics" updates client-go to v0.22.2 which introduces several break changes, this commit updates the related codes as well

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-11-03 13:30:26 -07:00
Wenkai Yin(尹文开) 163e96b62d
Don't create a backup immediately after creating a schedule (#4281)
Don't create a backup immediately after creating a schedule
Fixes #1980

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-10-26 16:31:58 -07:00
Daniel Jiang d08c4bae4d Refine tag-release.sh
This commit makes several changes to `tag-release.sh` according to the
change in release process:
1. It will support a "ON_RELEASE_BRANCH" param passed via env variable.
   When it's set to "TRUE". The release will be created on the commit of
   branch like `release-xxx`.  This enables us to create release branch
   before GA and tag RC release.
2. It removes the code to push a new branch to upstream.  This is
   because we decided to create branch manually.  For patch releases, we
   will not push the change to release branch, instead, we will make
   sure the release branch has all commits cherrypicked BEFORE we run
   this script to tag the release.

After the change the script will focus on only tag the release, not
making other code change to release branches.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-09-22 21:20:03 +08:00
danfengliu 8827b4f1d9
Fix plugins incompatible issue in upgrade test (#4141)
In upgrade test, both original and to-be-upgrading velero installation should use the compatible plugins, but currently, plugin value is determined by provider.

Signed-off-by: danfengl <danfengl@vmware.com>
2021-09-21 19:39:35 -07:00
Daniel Jiang b9eb6fdb33
Merge pull request #4107 from zubron/release-1.7-rc.1
Generate docs and changelog for v1.7
2021-09-09 08:53:25 +08:00
danfengl 4db866a0b2 Add upgrade test into E2E tests
Signed-off-by: danfengl <danfengl@vmware.com>
2021-09-08 13:16:53 +00:00
Bridget McErlean 5e50a50e84 Generate 1.7 changelog
Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-09-07 23:03:12 -04:00
codegold79 fbd6bcf504
Validate namespace in velero backup create command (#4057)
* Add namespace validation in the client

Signed-off-by: F. Gold <fgold@vmware.com>

* Add namespace validation in the backup controller

Signed-off-by: F. Gold <fgold@vmware.com>

* Add changelog for PR 4057

Signed-off-by: F. Gold <fgold@vmware.com>

* Update Copyright notice

Signed-off-by: F. Gold <fgold@vmware.com>

* Update include_excludes_test.go to follow Go standards and be easier to read

Signed-off-by: F. Gold <fgold@vmware.com>

* Add unit tests for namespace validation functions

Signed-off-by: F. Gold <fgold@vmware.com>

* Make changes per review comments

- use one set of namespace validation logic instead of writing two
- remove duplicate namespace validation functions and tests
- add namespace validation tests in includes_excludes_test.go

Signed-off-by: F. Gold <fgold@vmware.com>

* Return all ns validation err msgs as error list

Signed-off-by: F. Gold <fgold@vmware.com>

* Make error message more clear

Signed-off-by: F. Gold <fgold@vmware.com>
2021-09-03 11:03:35 -04:00
Wenkai Yin(尹文开) 305dfa0d3c
Empty the "ClusterIPs" along with "ClusterIP" when "ClusterIP" isn't "None" (#4101)
More details please refer to #4098

Fixes #4098

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-09-03 10:33:50 -04:00
Daniel Jiang 240b4e666f
Merge pull request #4026 from sseago/service-action-unnamed-nodeport
Distinguish between different unnamed node ports when preserving
2021-09-03 20:36:58 +08:00
Bridget McErlean edeec848d3
Skip restic backup/restore of DownwardAPI volumes (#4076)
Velero was including DownwardAPI volumes when backing up with restic.
When restoring these volumes, it triggered a known issue with restic (as
seen in #3863). Like projected volumes, these volumes should be skipped
as their contents are populated by the Kubernetes API server.

With this change, we are now skipping the restic backup of volumes with
a DownwardAPI source. We are also skipping the restore of any volume
that had a DownwardAPI source as there will exist backups that were
taken prior to this fix being introduced. This will allow these backups
to be restored succesfully.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-09-01 13:51:44 +08:00
MatthieuFin c4e53b9365 add changelog
Signed-off-by: MatthieuFin <matthieu2717@gmail.com>
2021-08-31 17:25:20 +02:00
Daniel Jiang 7c75cd6cf8
Implement `velero debug` (#4022)
This PR added a subcommand `velero debug`, which leverages `crashd` to
collect logs and specs of velero server components and bundle them in a
tarball.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-08-30 18:37:18 -07:00
kahirokunn cf42054c8c add changelog
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
2021-08-24 17:13:11 +09:00
Wenkai Yin(尹文开) 23e0e5d18f
Change the base image to distroless (#4055)
Change the base image to distroless

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-08-20 16:01:06 +08:00
Dharma Bellamkonda dc1f17944e
Page list requests by default (#3823)
Signed-off-by: Dharma Bellamkonda <bellamko@adobe.com>
2021-08-17 18:49:41 -07:00
Wenkai Yin(尹文开) 31a8e5080c
Wait the namespace deletion completed before removing the CRDs (#4007)
Wait the namespace deletion completed before removing the CRDs when uninstalling the velero

Fixes #3974

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-08-17 08:55:22 -07:00
Bridget McErlean 984176f156 Skip restore of APIServices managed by Kubernetes
It was discovered during Velero 1.6.3 upgrade testing that Velero was
restoring `APIService` objects for APIs that are no longer being served
by Kubernetes 1.22. If these items were restored, it would break the
behaviour of discovery within the cluster.

This change introduces a new RestoreItemAction plugin that skips the
restore of any `APIService` object which is managed by Kubernetes such
as those for built-in APIs or CRDs. The `APIService`s for these will be
created when the Kubernetes API server starts or when new CRDs are
registered. These objects are identified by looking for the
`kube-aggregator.kubernetes.io/automanaged` label.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-08-10 18:22:00 -04:00
Scott Seago 8d714d38ea Distinguish between different unnamed node ports when preserving
Signed-off-by: Scott Seago <sseago@redhat.com>
2021-08-09 16:35:07 -04:00
Bridget McErlean d98c65f69e
Use appropriate CRD API during readiness check (#4015)
* Use appropriate CRD API during readiness check

The readiness check for the Velero CRDs was still using the v1beta1 API.
This would cause the readiness check to fail on 1.22 clusters as the
v1beta1 API is no longer available. Previously, this error would be
ignored and the installation would proceed, however with #4002, we are
no longer ignoring errors from this check.

This change modifies the CRD readiness check to check the CRDs using the
same API version that was used when submitting the CRDs to the cluster.
It also introduces a new CRD builder using the V1 API for testing.

This change also fixes a bug that was identified in the polling code
where if the CRDs were not ready on the first polling iteration, they
would be added again to the list of CRDs to check resulting in
duplicates. This would cause the length check to fail on all subsequent
polls and the timeout would always be reached.

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

* Remove duplicate V1 CRD builder and update comment

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-08-05 15:17:14 -04:00
Marcel Haupt 7cb614789c
Restic Backup: Add check if Pod is successful or failed for emptyDir.… (#3993)
* Restic Backup: Add check if Pod is successful or failed for emptyDir. Fix #3812
* Add changelog

Signed-off-by: mahaupt <marcel.haupt@gepardec.com>
2021-08-04 12:53:06 +08:00
Daniel Jiang 6ae9a6eb37
Bump up Go to 1.16 (#3990)
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-07-29 23:56:08 -07:00
Wenkai Yin(尹文开) d8141eabce
Select the velero deployment with both label and container name (#3996)
Select the velero deployment with both label and container name

Fixes #3961

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-07-29 12:01:48 -04:00
Scott Seago 2c46b47404 enable e2e tests to choose crd apiVersion
Signed-off-by: Scott Seago <sseago@redhat.com>
2021-07-28 17:40:30 -04:00
JenTing Hsiao ee920ea9bc Add changelog
Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
2021-07-27 17:55:34 -04:00
Jai Subash Devmane 36b1aaa99d
Fixing multipleNamespaceTest bug - Missing expect statement in test (#3983)
* Fixing multipleNamespaceTest bug - No expect statement in test
* adding changelog

Signed-off-by: Jai Subash Devmane <jdevmane@redhat.com>
2021-07-27 15:32:36 +08:00
Wenkai Yin(尹文开) 70526806f1
Merge pull request #3919 from jaidevmane/installVeleroFix
Fix -install-velero flag for e2e tests
2021-07-20 18:57:12 +08:00
Scott Seago ff916b74e9
Merge pull request #3857 from zubron/use-region-in-bsl-for-restic-repo-identifier
Use region in BSL for restic repo identifier
2021-07-13 10:56:20 -04:00
JenTing Hsiao 25a72f90db
Add changelog
Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
2021-07-06 17:04:00 +08:00
Jai Subash Devmane db375f34c1 Fix -install-velero flag for e2e tests
Signed-off-by: Jai Subash Devmane <jdevmane@redhat.com>
2021-07-02 17:21:36 -04:00
Wenkai Yin(尹文开) bb05ed390b Enable the E2E test on Github Action
1. Run the E2E test with kind(provision various versions of k8s cluster) and MinIO on Github Action
2. Bug fix: the variable "stdoutBuf" is assigned to both "installPluginCmd.Stdout" and "installPluginCmd.Stderr", this causes 'if !strings.Contains(stderrBuf.String(), "Duplicate value")' takes no effect as the "stderrBuf.String()" is always empty
3. Print the stdout and stderr for easy debugging

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2021-06-30 21:45:26 +08:00
Scott Seago 962a957f1b
regression introduced in 1.6 restore progress: fix CR restore (#3845)
Signed-off-by: Scott Seago <sseago@redhat.com>
2021-06-19 00:03:11 -07:00
Arush Salil ae6e1df9aa
Add Labels field to BackupSpec (#3641)
* Add metadata.Labels to schedule.Spec.Template and it's copy logic to Backup

Signed-off-by: Arush Salil <me@aru.sh>

* document metadata.labels

Signed-off-by: Klavs Klavsen <klavs@enableit.dk>

* adjust text per suggestion.

Signed-off-by: Klavs Klavsen <klavs@enableit.dk>

* Rewrite labels copy logic, add comments, and debug log messages

Signed-off-by: Arush Salil <me@aru.sh>

* Rephrase label copy debug log

Signed-off-by: Arush Salil <me@aru.sh>

* Add initialized logger to FromSchedule

Signed-off-by: Arush Salil <me@aru.sh>

* use info log level per request.

Signed-off-by: Klavs Klavsen <klavs@enableit.dk>

Co-authored-by: Klavs Klavsen <klavs@enableit.dk>
2021-06-17 11:18:37 -07:00
Bridget McErlean f727e070cb
Skip volume restores from projected sources (#3877)
In #3863, it was discovered that volumes from projected sources were
being backed up by restic when they should have been skipped. Restoring
these volumes triggers a known bug in restic.

In #3866, we started skipping volumes from a projected source, however
there will exist backups that were taken before this fix was introduced.
This change modifies the restore logic to skip the restore of any volume
that came from a projected source, allowing backups taken before #3866
to be restored successfully.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-06-17 11:00:37 -07:00
Alay Patel 57a76b7a6b skip backuping projected volume
Signed-off-by: Alay Patel <alay1431@gmail.com>
2021-06-11 00:11:27 -04:00
Bridget McErlean 1495d61a68 Update changelog for new PR.
Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-06-09 16:40:57 -04:00
David L. Smith-Uchida 0aa3c263b4
Added BackupPhaseUploading and BackupPhaseUploadingPartialFailure backup (#3805)
phases as part of Upload Progress Monitoring, fixes #3755 Add backup phases
needed for Upload Progress Monitoring

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>
2021-06-02 14:25:19 +08:00
Scott Seago 20eb92f9dd
Add PVC UID label to PVR (as we already have for PVB) (#3792)
Signed-off-by: Scott Seago <sseago@redhat.com>
2021-05-20 09:16:06 +08:00
Eric Fried 7566962b95
Support pulling plugins by digest (#3803)
Previously `WithPlugins` only supported passing image URIs "by tag" --
e.g. `gcr.io/my-repo/my-image:v0.1.2`. With this commit, we add support
for pulling "by digest" -- e.g.
`gcr.io/my-repo/my-image@sha256:a75f9e8c3ced3943515f249597be389f8233e1258d289b11184796edceaa7dab`

Signed-off-by: Eric Fried <efried@redhat.com>
2021-05-18 13:27:49 +08:00
Alay Patel 31ced582a9
service_action: use unstructured to marshal selective fields (#3789)
* use unstructured to marshal selective fields

Signed-off-by: Alay Patel <alay1431@gmail.com>

* add a sample test for string port in applied config

Signed-off-by: Alay Patel <alay1431@gmail.com>

* update changelog

Signed-off-by: Alay Patel <alay1431@gmail.com>
2021-05-12 15:40:00 -04:00
Ashish Amarnath fc8569e9f0
⚠️ Remove CSI volumesnapshot artifact deletion (#3734)
This change is incompatible with velero-plugin-for-csi
releases <= v0.1.2

Remove special casing of CSI volumesnapshot artifacts
from backup deletion logic as this has been moved to
a DeleteItemAction plugin in the velero-plugin-for-csi repo

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
2021-05-04 13:58:41 -04:00
Ashish Amarnath 32c3820b8a
🐛 Fix plugin name derivation from image name (#3711)
* 🐛 Fix plugin name derivation from image name

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

* changelog

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
2021-04-21 20:57:00 -04:00
Bridget McErlean b7c166e019 Add changelog and docs for v1.6.0
Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-04-12 16:00:34 -04:00
Carlisia Thompson 9f24587cef
Upgrade docs for v1.6.0-rc2 (#3662)
* Update changelog for v1.6.0-rc.2

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

* Update docs for v1.6.0-rc.2

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

* Upgrade docs for v1.6.0-rc2

Signed-off-by: Carlisia <carlisia@vmware.com>
2021-04-05 15:31:30 -04:00
Carlisia Thompson c65c17c559
Revert printer columns (#3652)
* Revert "Add additional printer columns for CRDs (#2881)"

This reverts commit 4178d9de32.

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

* Add generated files

Signed-off-by: Carlisia <carlisia@vmware.com>
2021-03-31 14:46:37 -07:00
Bridget McErlean 5e72b87ef7 Add changelog and docs for v1.6.0-rc.1
Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-03-29 10:56:05 -04:00
Jalaja 40a1b62c09 use region input to detect the Bucket region
Signed-off-by: Jalaja Ganapathy <jalaja@replicated.com>

Signed-off-by: Jalaja <jalaja@replicated.com>
2021-03-24 00:26:51 +00:00
Ashish Amarnath 2cddda84c5
Upgrade restic from v0.9.6 to v0.12.0 (#3528)
* Upgrade restic from v0.9.6 to v0.12.0

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

* add changelog

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
2021-03-11 13:11:23 -05:00
Bridget McErlean 9ffffda11e
Use Credential from BSL for restic commands (#3489)
* Use Credential from BSL for restic commands

This change introduces support for restic to make use of per-BSL
credentials. It makes use of the `credentials.FileStore` introduced in
PR #3442 to write the BSL credentials to disk. To support per-BSL
credentials for restic, the environment for the restic commands needs to
be modified for each provider to ensure that the credentials are
provided via the correct provider specific environment variables.
This change introduces a new function `restic.CmdEnv` to check the BSL
provider and create the correct mapping of environment variables for
each provider.

Previously, AWS and GCP could rely on the environment variables in the
Velero deployments to obtain the credentials file, but now these
environment variables need to be set with the path to the serialized
credentials file if a credential is set on the BSL.

For Azure, the credentials file in the environment was loaded and parsed
to set the environment variables for restic. Now, we check if the BSL
has a credential, and if it does, load and parse that file instead.

This change also introduces a few other small improvements. Now that we
are fetching the BSL to check for the `Credential` field, we can use the
BSL directly to get the `CACert` which means that we can remove the
`GetCACert` function. Also, now that we have a way to serialize secrets
to disk, we can use the `credentials.FileStore` to get a temp file for
the restic repo password and remove the `restic.TempCredentialsFile`
function.

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

* Add documentation for per-BSL credentials

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

* Address review feedback

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

* Address review comments

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-03-11 13:10:51 -05:00
Bridget McErlean 3656f45f55
Partially revert adding credentials to VSL (#3561)
We are no longer adding the Credentials field to the VSL so this reverts
part the change that added it (#3409).

The original PR also added the `snapshot-location set` command. This
command only included options for setting the credential but is part of
the work for #2426. Due to this, the command has been left in place
(with the credentials option removed) but has been hidden.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-03-11 10:10:27 -08:00
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
Pranav Gaikwad c46fe71b12
Restore progress reporting (#3125)
* restore progress reporting

Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>

* add restore statistics to describe restore

Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>

* address feedback, include namespaces in the count

Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
2021-03-04 16:21:44 -05:00
Suraj Banakar ff1a31db4a
Support cli uninstall (#3399)
* Add uninstall cmd
- init fn to uninstall velero
- abstract dynamic client creation to a separate fn
- creates a separate client per unstructured resource
- add delete client for CRDs
- export appendUnstructured
- add uninstall command to main cmd
- export `podTemplateOption`
- uninstall resources in the reverse order of installation
- fallback to `velero` if no ns is provided during uninstall
- skip deletion if the resource doesn't exist
- handle resource not found error
- match log formatting with cli install logs
- add Delete fn to fake client
- fix import order
- add changelog
- add comment doc for CreateClient fn

Signed-off-by: Suraj Banakar <suraj@infracloud.io>

* Re-use uninstall code from test suite
- move helper functions out of test suite
- this is to prevent cyclic imports
- move uninstall helpers to uninstall cmd
- call them from test suite
- revert export of variables/fns from install code
- because not required anymore

Signed-off-by: Suraj Banakar <suraj@infracloud.io>

* Revert `PodTemplateOption` -> `podTemplateOption`

Signed-off-by: Suraj Banakar <suraj@infracloud.io>

* Use uninstall helper under VeleroUninstall
- as a wrapper
- fix import related errors in test suite

Signed-off-by: Suraj Banakar <suraj@infracloud.io>
2021-03-04 14:16:40 -05:00
Bridget McErlean 0246a32ad0
Use pod namespace from backup when matching PVBs (#3475)
* Use pod namespace from backup when matching PVBs

In #3051, we introduced an additional check to ensure that a PVB matched
a particular pod by checking both the name and the namespace of the pod.
This caused an issue when using a namespace mapping on restore. In the
case where a namespace mapping is being used, the check for whether a
PVB matches a particular pod will fail as the PVB was created for the
original pod namespace and is not aware of the new namespace mapping
being used. This resulted in PVRs not being created for pods that were
being restored into new namespaces. The restic init containers were
being created to wait on the volume restore, however this would cause
the restored pods to block indefinitely as they would be waiting for a
volume restore that was not scheduled.

To fix this, we use the original namespace of the pod from the backup to
match the PVB to the pod being restored, not the new namespace where
the pod is being restored into.

Fixes #3467.

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

* Explain why the namespace mapping can't be used

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-02-22 11:16:00 -08:00
codegold79 6bdd4ac192
Restore API group version by priority (#3133)
* Restore API group version by priority

Signed-off-by: F. Gold <fgold@vmware.com>

* Add changelog

Signed-off-by: F. Gold <fgold@vmware.com>

* Correct spelling

Signed-off-by: F. Gold <fgold@vmware.com>

* Refactor userResourceGroupVersionPriorities(...) to accept config map, adjust unit test

Signed-off-by: F. Gold <fgold@vmware.com>

* Move some unit tests into e2e

Signed-off-by: F. Gold <fgold@vmware.com>

* Add three e2e tests using Testify Suites

Summary of changes

Makefile - add testify e2e test target
go.sum - changed with go mod tidy
pkg/install/install.go - increased polling timeout
test/e2e/restore_priority_group_test.go - deleted
test/e2e/restore_test.go - deleted
test/e2e/velero_utils.go - made restic optional in velero install
test/e2e_testify/Makefile - makefile for testify e2e tests
test/e2e_testify/README.md - example command for running tests
test/e2e_testify/common_test.go - helper functions
test/e2e_testify/e2e_suite_test.go - prepare for tests and run
test/e2e_testify/restore_priority_apigv_test.go - test cases

Signed-off-by: F. Gold <fgold@vmware.com>

* Make changes per @nrb code review

Signed-off-by: F. Gold <fgold@vmware.com>

* Wait for pods in e2e tests

Signed-off-by: F. Gold <fgold@vmware.com>

* Remove testify suites e2e scaffolding moved to PR #3354

Signed-off-by: F. Gold <fgold@vmware.com>

* Make changes per @brito-rafa and Velero maintainers code reviews

- Made changes suggested by @brito-rafa in GitHub.
- We had a code review meeting with @carlisia, @dsu-igeek, @zubron, and @nrb
- and changes were made based on their suggetions:
  - pull in logic from 'meetsAPIGVResotreReqs()' to restore.go.
  - add TODO to remove APIGroupVersionFeatureFlag check
  - have feature flag and backup version format checks in separate `if` statements.
  - rename variables to be sourceGVs, targetGVs, and userGVs.

Signed-off-by: F. Gold <fgold@vmware.com>

* Convert Testify Suites e2e tests to existing Ginkgo framework

Signed-off-by: F. Gold <fgold@vmware.com>

* Made changes per @zubron PR review

Signed-off-by: F. Gold <fgold@vmware.com>

* Run go mod tidy after resolving go.sum merge conflict

Signed-off-by: F. Gold <fgold@vmware.com>

* Add feature documentation to velero.io site

Signed-off-by: F. Gold <fgold@vmware.com>

* Add config map e2e test; rename e2e test file and name

Signed-off-by: F. Gold <fgold@vmware.com>

* Update go.{mod,sum} files

Signed-off-by: F. Gold <fgold@vmware.com>

* Move CRDs and CRs to testdata folder

Signed-off-by: F. Gold <fgold@vmware.com>

* Fix typos in cert-manager to pass codespell CICD check

Signed-off-by: F. Gold <fgold@vmware.com>

* Make changes per @nrb code review round 2

- make checkAndReadDir function private
- add info level messages when priorties 1-3 API group versions can not be used

Signed-off-by: F. Gold <fgold@vmware.com>

* Make user config map rules less strict

Signed-off-by: F. Gold <fgold@vmware.com>

* Update e2e test image version in example

Signed-off-by: F. Gold <fgold@vmware.com>

* Update case A music-system controller code

Signed-off-by: F. Gold <fgold@vmware.com>

* Documentation updates

Signed-off-by: F. Gold <fgold@vmware.com>

* Update migration case documentation

Signed-off-by: F. Gold <fgold@vmware.com>
2021-02-16 12:36:17 -05:00
JenTing Hsiao a460caae13
Merge pull request #3446 from nrb/fix-CAPI-panic 2021-02-11 11:25:21 +08:00
codegold79 6455350940
Use label to select Velero deployment in plugin cmd (#3447)
* Use label to select Velero deployment in plugin cmd

Signed-off-by: F. Gold <fgold@vmware.com>

* Move veleroLabel constant closer to usage

Signed-off-by: F. Gold <fgold@vmware.com>

* Add changelog

Signed-off-by: F. Gold <fgold@vmware.com>

* Remove year from copyright in new file

Signed-off-by: F. Gold <fgold@vmware.com>

* Export and use install.Labels() function

Signed-off-by: F. Gold <fgold@vmware.com>
2021-02-10 20:42:04 -05:00
Nolan Brubaker 8bb1b12c2f Add changelog
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2021-02-10 14:28:43 -05:00
JenTing Hsiao 3070feaeb2
Merge pull request #3409 from nrb/add-credentials-to-vsls
Add credentials to VSLs
2021-02-10 09:07:41 +08:00
Carlisia 4b2aae308c Add changelog
Signed-off-by: Carlisia <carlisia@vmware.com>
2021-02-09 13:11:12 -08:00
Mikael Manukyan 36fc42761b
Add colors to describe command (#3275)
* Add colors to describe command

* Add colors to describe backups/restore/schedules commands
* Make name in the output bold
* Disable colors via `--colorized` flag or if velero isn't in TTY

Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com>
Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com>
Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com>

* Add changelog
* and run make update

Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com>
Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com>
Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com>

* Add colorized to the client config file

Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com>
Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com>
Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com>

* allow client config to use string values

* the command `velero client config set colorized=false` writes a string
value of "false" into the config. This change allows that string to be
accepted and converted into a boolean when used in program.

Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com>

* Add docs about colored CLI output

Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com>
Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com>

* Update site/content/docs/main/customize-installation.md

Co-authored-by: JenTing Hsiao <jenting.hsiao@suse.com>
Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com>

* docs: remove comma

* as per @carlisia 's suggestion

Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com>

Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com>
Co-authored-by: Clay Kauzlaric <clay.kauzlaric@gmail.com>
Co-authored-by: JenTing Hsiao <jenting.hsiao@suse.com>
2021-02-09 08:39:41 -08:00
JenTing Hsiao e115949d9b
feat: support set BackupStorageLocation(BSL) CA certificate (#3167)
* Rename --cacert-file to --cacert in the CLI design doc

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Add a new flag --cacert under `velero backup-location set`

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Add changelog

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Changelog rewording

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Revert CLI design doc

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
2021-02-08 13:28:47 -05:00
Taeuk Kim 529e05d6b2
Modify InitContainer checking function that potentially incurs error (#3198)
Signed-off-by: Taeuk Kim <taeuk_kim@tmax.co.kr>
2021-02-08 13:26:56 -05:00
Nolan Brubaker e5d83197f6 Add changelog entry
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2021-02-05 14:00:09 -05:00
Ron Green c4484d1c7e chore(changelog): add changelog message
Signed-off-by: Ron Green <11993626+georgettica@users.noreply.github.com>
2021-01-26 13:06:27 +02:00
JenTing Hsiao 870291141f
Support fish shell completion (#3231)
* Support fish shell completion

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Use spf13/cobra library to generate zsh completion

reference to https://github.com/spf13/cobra/blob/v1.1.1/shell_completions.md

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Update velero completion help message

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Add changelog

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Update cobra version in go.mod instead of replace

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Replace yourprogram to velero

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
2021-01-25 12:45:53 -05:00
Madhav Jivrajani 01853826b5
Raise logging level for PV deletion timeout (#3316)
* raised logging level for PV deletion timeout

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

* add changelog

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
2021-01-21 19:48:33 -05:00
Dave Smith-Uchida bb2891a881 Increased limit for Velero pod to 512M. Fixes #3234
Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>
2021-01-12 15:42:45 -08:00
JenTing Hsiao 4ae55bb20a
Capitalize all help messages (#3209)
Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
2021-01-05 16:36:15 -08:00
JenTing Hsiao 6fee09bbb9
Merge pull request #3172 from carlisia/c-bsl-imp
Improvements to BSL logic
2020-12-16 23:16:36 +08:00
matheusjuvelino 73693de5a3
issue: add flag to the schedule cmd to configure the `useOwnerReferencesInBackup` option #3176 (#3182)
* resolve: #3176

Signed-off-by: matheusjuvelino <matheus.juvelino@outlook.com>

* created changelog

Signed-off-by: matheusjuvelino <matheus.juvelino@outlook.com>

* fixed use-owner-rferences-in-backup flag for use-owner-references-in-backup

Signed-off-by: matheusjuvelino <matheus.juvelino@outlook.com>
2020-12-14 19:30:35 -05:00
matheusjuvelino 309d3dcf0a
Owner reference in backup when created from schedule (#3127)
* added useOwnerReferencesInBackup to crd velerio.io_schedules

Signed-off-by: matheusjuvelino <matheus.juvelino@outlook.com>

* added UseOwnerReferencesInBackup property to schedule.go

Signed-off-by: matheusjuvelino <matheus.juvelino@outlook.com>

* deepcopy schedule configured for reference the property UseOwnerReferencesInBackup

Signed-off-by: matheusjuvelino <matheus.juvelino@outlook.com>

* added UseOwnerReferencesInBackup property verification to modify OwnerReferences from backup

Signed-off-by: matheusjuvelino <matheus.juvelino@outlook.com>

* created changelog

Signed-off-by: matheusjuvelino <matheus.juvelino@outlook.com>

* removed deepcopy schedule configured for reference the property UseOwnerReferencesInBackup

Signed-off-by: matheusjuvelino <matheus.juvelino@outlook.com>

* running make update

Signed-off-by: matheusjuvelino <matheus.juvelino@outlook.com>

* running make update

Signed-off-by: matheusjuvelino <matheus.juvelino@outlook.com>

* updated the year at the top of the schedule.go file for 2020

Signed-off-by: matheusjuvelino <matheus.juvelino@outlook.com>
2020-12-11 13:10:34 -05:00
Carlisia fa65af87d0 Add changelog
Signed-off-by: Carlisia <carlisia@vmware.com>
2020-12-09 15:00:37 -08:00
yusufgungor 3b2e9036d1
Preserve nodePort support with --preserve-nodeports flag (#3095)
* -> Preserve nodePort support when restoring via "--preserve-nodeports" flag

Signed-off-by: Yusuf Güngör <yusuf.gungor@hepsiburada.com>

* -> Added changelog.

Signed-off-by: Yusuf Güngör <yusuf.gungor@hepsiburada.com>

* -> Unit test added.
-> Using boolptr.IsSetToTrue for bool ptr check.

Signed-off-by: Yusuf Güngör <yusuf.gungor@hepsiburada.com>

* -> Unit test added.
-> Using boolptr.IsSetToTrue for bool ptr check.

Signed-off-by: Yusuf Güngör <yusuf.gungor@hepsiburada.com>

* -> Other restore errors log level changed from info to error.
-> Documentation updated about Velero nodePort restore logic and preservation of them.

Signed-off-by: Yusuf Güngör <yusuf.gungor@hepsiburada.com>

Co-authored-by: Yusuf Güngör <yusuf.gungor@hepsiburada.com>
2020-12-09 09:32:34 -08:00
JenTing Hsiao 9dd158d13d
feat: support configure BSL CR to indicate which one is the default (#3092)
* Add default field to BSL CRD

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Add a new flag `--default` under `velero backup-location create`

add a new flag `--default` under `velero backup-location create`
to specify this new location to be the new default BSL.

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Add a new default field under `velero backup-location get`

add a new default field under `velero backup-location get` to indicate
which BSL is the default one.

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Add a new sub-command and flag under `velero backup-location`

Add a new sub-command called `velero backup-location set` sub-command
and a new flag `velero backup-cation set --default` to configure which
BSL is the default one.

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Add new flag to get the default backup-location

Add a new flag `--default` under `velero backup-location get`
to displays the current default BSL.

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Configures default BSL in BSL controller

When upgrade the BSL CRDs, none of the BSL has been labeled as default.
Sets the BSL default field to true if the BSL name matches to the default BSL setting.

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Configures the default BSL in BSL controller for velero upgrade

When upgrade the BSL CRDs, none of the BSL be marked as the default.
Sets the BSL `.spec.default: true` if the BSL name matches against the
`velero server --default-backup-storage-location`.

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Add unit test to test default BSL behavior

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Update check which one is the default BSL in backup/backup_sync/restore controller

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Add changelog

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Update docs locations.md and upgrade-to-1.6.md

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
2020-12-08 16:38:29 -05:00
Ashish Amarnath 7727d535a4
🐛 BSLs with validation disabled should be validated at least once (#3084)
* 🐛 BSLs with validation disabled should be validated at least once

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

* review comments

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
2020-12-03 07:52:36 -08:00
JenTing Hsiao 7f2de65b5b
feat: add delete sub-command for backup-location (#3073)
* feat: add delete sub-command for backup-location

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Change to use kubebuilder/runtimecontroller API

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* fix get BSL by label doesn't work

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Update changelog

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Ordering by alphabet

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Better example format for help message

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Capital the comments

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
2020-11-30 13:59:42 -05:00
Bridget McErlean a877354750
Don't fail backup deletion if downloading tarball fails (#2993)
* Don't fail backup if downloading tarball fails

Previously, we would always attempt to download the tarball for a backup
for processing DeleteItemAction plugins, even if there weren't any.
This caused an issue for some users in the case where the backup tarball
had been deleted from object storage as the backup deletion would fail.

Now, we only attempt to download the tarball in the case where there are
DeleteItemAction plugins. If downloading that tarball fails, we log
the error, skip the processing of the DeleteItemAction plugins and
proceed with the rest of the deletion.

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

* Skip file removal in closeAndRemoveFile if nil

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2020-11-30 10:58:34 -08:00
David L. Smith-Uchida aa47309700
Add an E2E test framework to test Velero across cloud platforms (#3060)
* Basic end-to-end tests, generate data/backup/remove/restore/verify
Uses distributed data generator

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* Moved backup/restore into velero_utils, started using a name for the restore

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* remove checked in binary and update test/e2e Makefile

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

* Ran make update

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* Save

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

* Ran make update

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* Basic end-to-end test, generate data/backup/remove/restore/verify
Uses distributed data generator

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* Changed tests/e2e Makefile to just use go get to install ginkgo in the GOPATH/bin
Updated to ginkgo 1.14.2
Put cobra back to v0.0.7

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* Added CLOUD_PLATFORM env variable to Makefile, updated README, removed ginkgo from .gitignore

Signed-off-by: Dave Smith-Uchida <dsmithuchida@vmware.com>

* choose velero CLI binary based on local env

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

Co-authored-by: Ashish Amarnath <ashisham@vmware.com>
2020-11-24 14:12:52 -05:00
Taeuk Kim 12d70e30a8
Modify function name typo (#3106)
Signed-off-by: Taeuk Kim <taeuk_kim@tmax.co.kr>
2020-11-23 11:28:34 -05:00
Misha Ketslah 8c8385aabb
pass annotations from scheduler to created backup (#3067)
* pass annotations from scheduler to created backup

Signed-off-by: Michael <michael.ketslah@tufin.com>

* add change log

Signed-off-by: Michael <michael.ketslah@tufin.com>

* add test for annotations in controller

Signed-off-by: Michael <michael.ketslah@tufin.com>

* If no annotations are set - do not copy empty list

Signed-off-by: Michael <michael.ketslah@tufin.com>

* remove unneeded var

Signed-off-by: Michael <michael.ketslah@tufin.com>

* add empty annotations and actually check annotations in backups

Signed-off-by: Michael <michael.ketslah@tufin.com>

* add empty missing label and empty annotations

Signed-off-by: Michael <michael.ketslah@tufin.com>

* revert empty annotations as seems they are nil as expected

Signed-off-by: Michael <michael.ketslah@tufin.com>

* fix typo in changelog

Signed-off-by: Michael <michael.ketslah@tufin.com>

Co-authored-by: Michael <michael.ketslah@tufin.com>
2020-11-19 13:19:42 -08:00
Madhav Jivrajani a386139788
Add instructions to clone repo for examples (#3074)
* Add instructions to clone repo for examples

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

* Add changelog

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

* Revert changes in v1.4 and 1.3.x

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

* Revert changes for v1.2.0

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
2020-11-17 16:28:03 -08:00
Ashish Amarnath 4f1d46c452
🏃‍♂️ update setup-kind github actions CI (#3085)
Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
2020-11-17 12:31:14 -05:00
Ashish Amarnath ecab583680
🐛 Do not run ItemAction plugins for unresolvable types for all types (#3059)
Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
2020-11-11 09:50:57 -05:00
Mateusz Gozdek 9acd4ac4d5
.github/workflows: add PR codespell workflow (#3064)
To avoid adding typos to the code base.

Follow up to #3057.

Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
2020-11-10 12:43:32 -08:00
Mateusz Gozdek dbc83af77b
Fix various typos found by codespell (#3057)
By running the following command:

codespell -S .git,*.png,*.jpg,*.woff,*.ttf,*.gif,*.ico -L \
iam,aks,ist,bridget,ue

Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
2020-11-10 11:48:35 -05:00
Ashish Amarnath dc6762a895
🐛 Use namespace and name to match PVB to Pod restore (#3051)
Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
2020-11-10 11:36:49 -05:00
Mayank 68a4b23722
fixing 'velero.io/change-pvc-node-selector' plugin to fetch configmap using plugin name (#2970)
* fixing label for 'velero.io/change-pvc-node-selector' plugin in site document

Signed-off-by: mayank <mayank.patel@mayadata.io>

* Fixing "velero.io/change-pvc-node-selector" to fetch config using plugin name

Signed-off-by: mayank <mayank.patel@mayadata.io>

* adding changelog

Signed-off-by: mayank <mayank.patel@mayadata.io>
2020-11-04 11:45:39 -08:00
Bridget McErlean 4178d9de32
Add additional printer columns for CRDs (#2881)
This change modifies the kubebuilder annotations for the Velero CRDs to
include `additionalPrinterColumns` so that more information is exposed
when using `kubectl get`.

For each of the CRDs, annotations have been added to make the output
for `kubectl get` match the output from the equivalent `velero get`
command as closely as possible. There are some cases where this output
could not be replicated, such as the `EXPIRES` column for Backups, due
to the limitations of JSONPath expressions within the resulting CRD
defition. Some columns undergo processing and formatting before being
printed by the Velero CLI which cannot be replicated using JSONPath. In
these cases, these printer columns have been omitted.

For other CRDs where there is no `velero get` equivalent, such as
`PodVolumeBackup` and `PodVolumeRestore`, a best effort has been made to
expose information that provides value.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2020-10-27 15:19:33 -07:00
Hariharan df982c9fc9
Add warning to velero version cmd. Fixes #3017 (#3024)
Signed-off-by: Hariharan <cvhariharan@protonmail.com>
2020-10-23 17:33:13 -04:00
Piper Dougherty 60ff351269
Adding fix for restic init container index on restores. (#3011)
* Adding handling of restic-wait init container at any order with warning.

Signed-off-by: Piper Dougherty <doughertypiper@gmail.com>

* Adding newline at end of files to match convention.

Signed-off-by: Piper Dougherty <doughertypiper@gmail.com>

* Formatting.

Signed-off-by: Piper Dougherty <doughertypiper@gmail.com>

* Update copyright year on modified files.

Signed-off-by: Piper Dougherty <doughertypiper@gmail.com>
2020-10-21 15:15:03 -07:00
Nolan Brubaker 28a46d3a8b
Ensure PVs and PVCs remain bound when doing a restore (#3007)
* Only remove the UID from a PV's claimRef

The UID is the only part of a claimRef that might prevent it from being
rebound correctly on a restore. The namespace and name within the
claimRef should be preserved in order to ensure that the PV is claimed
by the correct PVC on restore.

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Remap PVs claimRef.namespace on relevant restores

When remapping namespaces, any included PVs need to have their claimRef
updated to point remapped namespaces to the new namespace name in order
to be bound to the correct PVC.

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Update tests and ensure claimRef namespace remaps

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Remove lowercased uid field from unstructured PV

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Fix issues that prevented PVs from being restored

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Add changelog

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Dynamically reprovision volumes without snapshots

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Update test for lower case uid field

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Remove stray debugging print statement

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Fix typo, remove extra code, add tests.

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2020-10-15 16:57:43 -07:00
Alay Patel 467f5fb723
create CRB with velero-<namespace> (#2886)
* create CRB with velero-<namespace>

This will allow creating multiple instances of velero,
across two different namespaces

Signed-off-by: Alay Patel <alay1431@gmail.com>

* add changelog

Signed-off-by: Alay Patel <alay1431@gmail.com>

* add package var DefaultVeleroNamespace and use it wherever needed

Signed-off-by: Alay Patel <alay1431@gmail.com>
2020-10-13 16:13:42 -07:00
Gábor Lipták 3fb57c6b2e
Bump Go to 1.15 (#2974)
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2020-10-13 12:42:06 -07:00
Antony S Bett 35d25c81ec
Fix BSL controller to avoid invoking init() on all BSLs regardless of ValidationFrequency (#2992)
Signed-off-by: Bett, Antony <antony.bett@dell.com>
2020-10-13 12:10:32 -07:00
mickkael 228b474859
Allow Timezone change in the container (#2944)
* Allow Timezone change in the container

Allow Timezone change by specifying the env TZ in the deployment manifest
Signed-off-by: mickkael <19755421+mickkael@users.noreply.github.com>

* Change log for 2944

Signed-off-by: mickkael <19755421+mickkael@users.noreply.github.com>
2020-10-06 13:58:16 -04:00
Scott Seago d820bc5e72
restore proper lowercase/plural CRD resource (#2949)
* restore proper lowercase/plural CRD resource

This commit restores the proper resource string
"customresourcedefinitions" for CRD. The prior change to
"CustomResourceDefinition" was made because this was being used
in another place to populate the CRD "Kind" field in
remap_crd_version_action.go -- there, just use the correct Kind
string instead of pulling from Resource.

Signed-off-by: Scott Seago <sseago@redhat.com>

* add changelog

Signed-off-by: Scott Seago <sseago@redhat.com>
2020-10-02 09:48:12 -04:00
Nolan Brubaker 2fa96d0839
Fix 'subcommand required' error w/ cobra upgrade (#2947)
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2020-09-17 14:08:26 -07:00
Nolan Brubaker 87d86a45a6
Add changelog and docs for v1.5 release (#2941)
* Add changelog and docs for v1.5 release

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Fix markdown indentation

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Fix URLs with patch version

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Fix example link

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2020-09-16 17:17:30 -04:00
Ashish Amarnath cfc4651078
🏃‍♂️ add shortnames for CRDs (#2911)
Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
2020-09-10 12:28:17 -07:00
Carlisia Thompson b60e6ff21e
v1.5.0-rc.1 release (#2921)
* v1.5.0-rc.1 release

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

* Reviews

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

* Re-generate docs

Signed-off-by: Carlisia <carlisia@vmware.com>
2020-09-09 16:25:47 -07:00
JenTing Hsiao cd31141b93
Show format version on velero backup describe (#2901)
* Show format version on velero backup describe

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>

* Add changelog

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
2020-09-08 16:08:56 -04:00
Andrew Reed 0547b1d945
Restore hooks exec (#2804)
* Exec hooks in restored pods

Signed-off-by: Andrew Reed <andrew@replicated.com>

* WaitExecHookHandler implements ItemHookHandler

This required adding a context.Context argument to the ItemHookHandler
interface which is unused by the DefaultItemHookHandler implementation.
It also means passing nil for the []ResourceHook argument since that
holds BackupResourceHook.

Signed-off-by: Andrew Reed <andrew@replicated.com>

* WaitExecHookHandler unit tests

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Changelog and go fmt

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Fix double import

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Default to first contaienr in pod

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Use constants for hook error modes in tests

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Revert to separate WaitExecHookHandler interface

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Negative tests for invalid timeout annotations

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Rename NamedExecRestoreHook PodExecRestoreHook

Also make field names more descriptive.

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Cleanup test names

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Separate maxHookWait and add unit tests

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Comment on maxWait <= 0

Also info log container is not running for hooks to execute in.
Also add context error to hooks not executed errors.

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Remove log about default for invalid timeout

There is no default wait or exec timeout.

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Linting

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Fix log message and rename controller to podWatcher

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Comment on exactly-once semantics for handler

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Fix logging and comments

Use filed logger for pod in handler.
Add comment about pod changes in unit tests.
Use kube util NamespaceAndName in messages.

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Fix maxHookWait

Signed-off-by: Andrew Reed <andrew@replicated.com>
2020-09-08 11:33:15 -07:00
Pawan Prakash Sharma debcbd2f8e
fix: rename the PV if VolumeSnapshotter has modified the PV name (#2835)
* fix: rename the PV if VolumeSnapshotter has modified the PV name

When VolumeSnapshotter sets the PV name via SetVolumeID and PV is
not there in the cluster, velero does not rename the PV. Which causes
the pvc to be in the lost state as pvc points to the old PV but pv object
has been renamed by VolumeSnapshotter.

Signed-off-by: Pawan <pawan@mayadata.io>

* adding a test case for pv rename

Signed-off-by: Pawan <pawan@mayadata.io>
2020-09-01 14:25:13 -07:00
Carlisia Campos c952932f1b
Migrate ServerStatusRequest controller and resource to kubebuilder (#2838)
* Convert ServerStatusRequest controller to controller-runtime

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

* Add select stm

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

* Fixed status patch bug

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

* Add mgr start

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

* Trying to sync

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

* Clean async now

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

* Clean up + move context out

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

* Bug: not closing the channel

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

* Clean up some tests

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

* Much better way to fetch an update using a backoff loop

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

* Even better way to retry: use apimachinery lib

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

* Refactor controller + add test

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

* partially fix unit tests

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

* Fix and add tests

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

* Add changelog

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

* Add ability to disable the controller + cleanups

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

* Fix bug w/ disabling controllers + fix test + clean up

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

* Move role.yaml to the correct folder

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

* Add sample serverstatusrequest.yaml

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

* Add requeue + better formatting

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

* Increase # of max concurrent reconciles

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

Co-authored-by: Ashish Amarnath <ashisham@vmware.com>
2020-09-01 14:15:23 -07:00
JenTing Hsiao 1513674548
fix EnableAPIGroupersions output log format (#2882)
Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
2020-09-01 13:50:44 -04:00