Commit Graph

1063 Commits (2a4586ba08c45285f464f249252aef015cff3b5c)

Author SHA1 Message Date
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 930508be60 Better validation
Signed-off-by: Carlisia <carlisia@vmware.com>
2021-02-09 13:18:45 -08:00
Carlisia b7c2f2d7ed Better help messages and validation check
Signed-off-by: Carlisia <carlisia@vmware.com>
2021-02-09 13:18:45 -08:00
Carlisia 60cbac1e9f Fix typo
Signed-off-by: Carlisia <carlisia@vmware.com>
2021-02-09 13:17:49 -08:00
Carlisia 9dbb8b6906 Add credential field to the bsl
Signed-off-by: Carlisia <carlisia@vmware.com>
2021-02-09 13:11:11 -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 e0ccc9942c Instantiate the flag map on set
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2021-02-08 13:07:20 -05:00
Bridget McErlean 38c08e087b
Replace NewObjectBackupStore with interface (#3329)
In preparation for modifying the instantiation of `BackupStores` to be
able to load credentials, change the function `NewObjectBackupStore` to
be an interface that is passed in to all controllers.

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

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-02-08 13:04:08 -05:00
Nolan Brubaker 328ba8228b Add snapshot-location set command
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2021-02-05 13:54:08 -05:00
Nolan Brubaker c7bbb9870d Add credential arg to snapshot-location create
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2021-02-05 13:40:33 -05:00
Nolan Brubaker 31e4cc0e3b Add credential field to VolumeSnapshotLocation
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2021-02-05 13:40:08 -05:00
steve_chph a8ef1a65ff
Fix typo (#3352)
Signed-off-by: peihongchen <171250610@smail.nju.edu.cn>
2021-01-27 08:59:23 -05:00
Ron Green cba96280fd fix(tests): make tests pass?
this fix is from my understanding of the context package, can be fixed later

Signed-off-by: Ron Green <11993626+georgettica@users.noreply.github.com>
2021-01-26 20:40:33 +02:00
Ron Green f0472bde71 fix(tests): make tests pass
- change to new api resource

not all tests are passing, but most of them do

Signed-off-by: Ron Green <11993626+georgettica@users.noreply.github.com>
2021-01-26 13:06:27 +02:00
Ron Green ef07b72dbc fix: apply patch
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
Signed-off-by: Ron Green <11993626+georgettica@users.noreply.github.com>
2021-01-26 13:06:27 +02:00
Ron Green 8bb3615339 feat(gomod): bump versions
now versions are working and there are code changes that need to happen

- release candidate versions are aligned and working
- replaces fields are removed and not required anymore

controller runtime has been changed during the 'make' command

Signed-off-by: Ron Green <11993626+georgettica@users.noreply.github.com>
2021-01-26 13:06:27 +02:00
Ron Green 861cc78bcd refactor(external-snapshotter): bump to v4
Signed-off-by: Ron Green <11993626+georgettica@users.noreply.github.com>
2021-01-26 13:06:27 +02:00
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
Carlisia Thompson 9e29e50773
Minor kubebuilder related items to clean up (#3180)
* Remove unnecessary files

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

* Switch to CAPI patch function for updates

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

* Improve table test format

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

* Refactor and add test for disabling controller

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

* Add tests

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

* Change test to use real word

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

* Fix CI

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

* Minor test fixes

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

* Remove rback/role generation

Signed-off-by: Carlisia <carlisia@vmware.com>
2021-01-21 18:22:34 -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 be5fbb00ea
Merge pull request #3186 from carlisia/c-plugin-naming
Minor refactor plus better documentation for plugin naming
2020-12-16 23:53:56 +08:00
JenTing Hsiao 12d4aff3db
Merge pull request #3183 from carlisia/c-name
Better name format for init containers
2020-12-16 23:16:48 +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
Carlisia 63301213bd Improve name formatting logic and add more tests
Signed-off-by: Carlisia <carlisia@vmware.com>
2020-12-14 18:32:37 -08:00
Carlisia 203a103fc4 Minor refactor plus better documentation for naming
Signed-off-by: Carlisia <carlisia@vmware.com>
2020-12-14 16:52:52 -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
Carlisia 2de7c7924c Better name format for init containers
Signed-off-by: Carlisia <carlisia@vmware.com>
2020-12-14 14:14:12 -08: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 bd10b7660c Improvements to BSL logic
Signed-off-by: Carlisia <carlisia@vmware.com>
2020-12-09 13:25:01 -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
Ashish Amarnath b321838c72
🏃‍♂️ reducing verbosity of another log message (#3109)
Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
2020-11-24 08:12:51 -08: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
Ashish Amarnath 9b20e8d2e6
🏃‍♂️ Turn down logging verbosity (#3091)
Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
2020-11-19 14:03:29 -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 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
Ashish Amarnath 1be97a2b04
🏃‍♂ Improve log message clarity (#3047)
Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
2020-11-02 13:39:32 -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