Commit Graph

754 Commits (2254635bcb08183d903c12f51182014a5de1d3fc)

Author SHA1 Message Date
Carlisia 520077c3a9
Fix test comparison
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-06-10 16:34:29 -07:00
Steve Kriss e183c4b597 remove glog (#1559)
* remove glog refs, replace with klog equivalents

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

* remove glog from deps

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

* changelog

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-10 15:44:44 -07:00
Adnan Abdulhussein d6c60b2dd5 fix panic when processing DeleteBackupRequest objs without labels (#1556)
This fix initialises an empty map if the request object's Labels map
is nil, allowing the controller to later add and modify labels on the
object.

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
2019-06-10 10:04:51 -07:00
Steve Kriss 9e7ff4e3d9 Refactoring for backup item action tests (#1545)
* migrate and enhance backup item action tests

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

* migrate terminating resource test

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

* add godoc for test functions

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-09 21:02:49 -07:00
Pranav Gaikwad bb12cbd2d7 Support for multiple AWS profiles (#1548)
* added support for multiple AWS credential profiles

Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
2019-06-07 11:01:39 -07:00
KubeKween 0a771e6a53 Add cmd to list plugins (#1535)
* Add cmd to list plugins

Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-06-05 13:41:02 -04:00
Steve Kriss bc7ee686d7
Merge pull request #1428 from guilhem/glob
Add ability to use wildcard in includes/excludes
2019-06-05 09:53:37 -06:00
Guilhem Lettron 81a26e4aad Add ability to use wildcard in includes/excludes
Use https://github.com/gobwas/glob as glob engine
Fix #373

Signed-off-by: Guilhem Lettron <guilhem@barpilot.io>
2019-06-05 16:28:25 +02:00
Steve Kriss caa0bff5a3 Initial pkg/backup test refactoring (#1532)
Initial pkg/backup test refactoring

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-06-04 19:47:22 -07:00
KubeKween 0804f34644 Don't log error if restic volume is empty (#1480)
* Don't log error if restic volume is empty

Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-05-30 12:48:21 -04:00
Steve Kriss 411d44a673 allow individual backup storage locations to be read-only (#1517)
* allow individual backup storage locations to be read-only

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-29 14:21:25 -04:00
Steve Kriss 9287505f62 fixes for breaking changes
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-20 13:25:36 -06:00
Steve Kriss 02c7df9ea0 update generated code
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-20 13:25:36 -06:00
Nolan Brubaker b3c6e5e483 Add more examples to schedule create (#1473)
Partially addresses #1464

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-13 09:25:25 -07:00
Nolan Brubaker c209f0c0c3 Add snapshot-location to `velero create` command (#1472)
`velero snapshot-location create` existed, but not `velero create
snapshot-location`; update subcommand for parity with backup-location

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-13 09:23:25 -07:00
Nolan Brubaker e0bc14d56b Add flag to disable creation of VSL on install
Fixes #1453

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-09 15:04:42 -04:00
Fábio Franco Uechi 58d34700da Add new gauge to hold the timestamp of the last successful backup (#1448)
* add new gauge to hold the timestamp of the last sucessfull backup

Signed-off-by: fabito <fuechi@ciandt.com>

* add changelog entry

Signed-off-by: fabito <fuechi@ciandt.com>

* fix gauge name

Signed-off-by: fabito <fuechi@ciandt.com>

* renaming metric to backup_last_successful_timestamp

Signed-off-by: fabito <fuechi@ciandt.com>

* fix typo

Signed-off-by: fabito <fuechi@ciandt.com>

* ✏️ fix typo II

Signed-off-by: fabito <fuechi@ciandt.com>

* 🔀 rename method

Signed-off-by: fabito <fuechi@ciandt.com>
2019-05-08 07:00:26 -06:00
Nolan Brubaker 05b8edf894
Merge pull request #1457 from skriss/shortcuts-perf-issue
shortcut expander: use discovery helper's cached resource list
2019-05-07 15:57:12 -04:00
Steve Kriss 90c89f764e shortcut expander: use discovery helper's cached resource list
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-07 12:23:45 -06:00
Fábio Franco Uechi 24d28c8633 Check for backup existence before download (#1447)
* check for backup existence in download command

Signed-off-by: fabito <fuechi@ciandt.com>
2019-05-06 12:24:29 -04:00
Nolan Brubaker 884e512f93 Use latest container image when version is empty (#1439)
When using `velero install`, the image used should be a reasonable
default, even if buildinfo.Version is missing (such as when using `go
build` directly).

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-05-03 11:10:47 -07:00
Nolan Brubaker de79f4d0b7
Merge pull request #1405 from skriss/gcp-project
GCP: add optional 'project' config to volume snapshot location
2019-05-03 11:24:42 -04:00
Steve Kriss 2406994740 remove ref to v0.10 from BSL validation error msg (#1429)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-05-02 11:20:50 -07:00
Anshul Chandra 4e12b08953 Validate restore name label length
Velero should handle cases when the label length exceeds 63 characters.

- if the length of the backup/restore name is <= 63 characters, use it as the value of the label
- if it's > 63 characters, take the SHA256 hash of the name. the value of
  the label will be the first 57 characters of the backup/restore name
  plus the first six characters of the SHA256 hash.

Fixes heptio#1021

Signed-off-by: Anshul Chandra <anshulc@vmware.com>
2019-05-01 10:25:11 -07:00
Nolan Brubaker 28612afa27
Merge pull request #1416 from skriss/restic-connect
switch to snapshots cmd for checking repo exists
2019-04-30 12:24:17 -04:00
Steve Kriss 660080e6f3 remove all remaining legacy Ark references (#1415)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-29 12:33:54 -07:00
Steve Kriss dea81bbe15 switch to snapshots cmd for checking repo exists
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-29 12:19:03 -06:00
Steve Kriss 3b5de11c74 update to optionally use distinct snapshot vs volume project
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-29 09:47:13 -06:00
Steve Kriss 4ed63edea0 GCP: add optional 'project' config to volume snapshot location
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-29 09:47:13 -06:00
Steve Kriss 8392e6d83f add PartiallyFailed phase for backups, log+continue on errors (#1386)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-26 09:14:26 -07:00
Steve Kriss 42f351b000
Merge pull request #1407 from nrb/bucket-dashes
Throw an error on an invalid bucket name
2019-04-25 15:41:19 -06:00
Nolan Brubaker bf19623e82
Merge pull request #1389 from skriss/restore-partially-failed
Add PartiallyFailed phase for restores
2019-04-25 17:06:26 -04:00
Nolan Brubaker 9e19ab8d8b Throw an error on an invalid bucket name
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-25 16:26:03 -04:00
Sylvain Rabot 011db15f1c azure: restore volumes with zone (#1298)
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
2019-04-25 11:25:57 -07:00
Nolan Brubaker 58bb7ed3aa
Merge pull request #1390 from carlisia/c-check-for-backup-III
Fail backup if it already exists in object storage
2019-04-24 17:31:48 -04:00
Carlisia 6f496a8921
Bug fix
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-24 14:18:24 -07:00
Steve Kriss 3155bb159f remove VolumeBackupInfo from API pkg (#1388)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-24 13:16:03 -07:00
Steve Kriss dcd663b8cf bug fix: set discovery helper's logger in constructor (#1399)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-24 13:12:03 -07:00
Carlisia fc25f0ae89
Clean up + changelog
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-24 12:04:19 -07:00
Steve Kriss c201a2c103 fix describer output
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-24 12:57:40 -06:00
Steve Kriss 1a55964326 update CLI outputs for PartiallyFailed phase
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-24 12:57:40 -06:00
Steve Kriss eb30ec0666 move restores to PartiallyFailed if >=1 error in restore results
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-24 12:57:40 -06:00
Carlisia 7d28f82540
Address code review
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-24 10:54:43 -07:00
Carlisia 38ccb40ca1
Add back code and tests
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-23 16:19:49 -07:00
Carlisia c59d03dfb1
Fix test?
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-22 15:22:58 -07:00
Carlisia c7bb288d87
More clean up
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-22 15:22:58 -07:00
Carlisia 05a88345e5
Code clean up
Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-22 15:22:58 -07:00
Andy Goldstein 01d0b026e9
Fail backup if it already exists in object storage
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2019-04-22 15:22:58 -07:00
Steve Kriss 134323fbf7
Merge pull request #1385 from nrb/deploy-tags
Provide more specific label for velero deployment
2019-04-19 12:37:28 -06:00
Nolan Brubaker 8870281afc
Merge pull request #1353 from fabito/gauge-for-number-of-backups-and-restores
Add gauge metrics for number of existing backups and restores
2019-04-19 12:52:55 -04:00
Steve Kriss 6dd007b507 remove deprecated hooks (replaced by pre hooks) (#1384)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-19 08:40:35 -07:00
Nolan Brubaker e85c367ce5 Provide more specific label for velero deployment
Using only the `component: velero` selector caused the restic pods to be
matched, as well, which made things such as `kubectl logs` return too
much information.

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-18 14:18:21 -04:00
Nolan Brubaker b01b12472f
Merge pull request #1375 from ctrox/gcp-snapshot-location
GCP: Implement configurable snapshot location
2019-04-18 12:06:18 -04:00
fabito 475cf2ab60 add new metrics (gauges): backup_total and restore_total
Signed-off-by: fabito <fuechi@ciandt.com>
2019-04-18 01:28:38 -03:00
Nolan Brubaker f8f0d15da2 Add --namespace parameter to install command (#1380)
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-17 09:38:14 -07:00
Cyrill Troxler 6020823aaf Add config parameter for gcp to customize the snapshot location
Signed-off-by: Cyrill Troxler <cyrill@nine.ch>
2019-04-17 18:34:09 +02:00
Nolan Brubaker 0750b2c789
Merge pull request #1367 from skriss/restic-repo-fixes
Restic repository management fixes
2019-04-17 11:49:17 -04:00
Nolan Brubaker 975bec692b
Merge pull request #1378 from skriss/move-restore-result
move RestoreResult from api to pkg/restore, rename to Result
2019-04-17 11:29:18 -04:00
Steve Kriss 5bc6695109 move RestoreResult from api to pkg/restore, rename to Result
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-16 12:57:02 -06:00
Jason Montleon 8c9ae491f0 Fix restic repository identifier
Signed-off-by: Jason Montleon <jmontleo@redhat.com>
2019-04-16 12:24:25 -04:00
Nolan Brubaker 6f474016a6 Add velero install command (#1287)
Add velero install command

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-15 14:10:11 -07:00
Steve Kriss bc8f07f963 Azure: add support for loading env vars from a file, $AZURE_CREDENTIALS_FILE (#1364)
* azure: load env vars from AZURE_CREDENTIALS_FILE if it exists

Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 14:05:13 -07:00
Nolan Brubaker 94f014101d
Merge pull request #1323 from skriss/v1.0-removals
v1.0 removals
2019-04-15 16:24:02 -04:00
Nolan Brubaker c38def0849
Merge pull request #1370 from skriss/install-fixes
add some missing config to pkg/install daemonset, deployment
2019-04-15 15:45:52 -04:00
Steve Kriss 66c6d7a026 add some missing config to pkg/install daemonset, deployment
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 13:12:35 -06:00
Steve Kriss 373e4c9abe update daemonset log to show version and SHA
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 11:27:04 -06:00
Steve Kriss c59544cb79 remove backup.status.volumeBackups and all related code
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:40 -06:00
Steve Kriss 6ed4e1f147 remove legacy metrics
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:03 -06:00
Steve Kriss b04d6b02f3 remove support for legacy restic annotations
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:03 -06:00
Steve Kriss 7f36f78aee remove code that removes legacy GC finalizer from backups
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:03 -06:00
Steve Kriss 892673816b remove legacy restore label
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:03 -06:00
Steve Kriss c8c03a38e9 remove support for legacy Azure snapshot ID format
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:03 -06:00
Steve Kriss ede9a8f5b4 remove support for legacy client config file
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:03 -06:00
Steve Kriss b87de94723 remove legacy hook annotation support
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:03 -06:00
Steve Kriss 77e648eafa remove Ark field from RestoreResult
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:17:02 -06:00
Steve Kriss d49008dec0 remove Ark API pkg and generated code
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:15:18 -06:00
Steve Kriss b03da3c0ed remove code referencing Ark API pkg
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-15 10:15:18 -06:00
Steve Kriss 3ed97db550
Merge pull request #1362 from nrb/include-resources-examples
Add example for restoring with --include-resources
2019-04-12 14:45:15 -06:00
Steve Kriss 44acdcbc60 repo ensurer: fix channel lifecycles
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-12 14:43:40 -06:00
Steve Kriss 5d06bd4ab9 restic repo controller: lower resync period to 5min
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-12 14:43:40 -06:00
Steve Kriss 0328a70ff0 repo ensurer: rename readyChans to repoChans
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-12 14:43:40 -06:00
Steve Kriss 8d61cb0384 repo ensurer: wait at most one minute for repo to become ready
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-12 14:43:40 -06:00
Steve Kriss f879670906 repo ensurer: return error if new repo becomes NotReady
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-12 14:43:40 -06:00
Steve Kriss 7251c8ca81 restic: change log statement from error to debug
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-12 14:43:40 -06:00
Steve Kriss 02cbb77dea
Merge pull request #1366 from nrb/fix-1363
Prepend velero.io to non-namespaced names
2019-04-12 14:43:17 -06:00
Nolan Brubaker d679498c8a Add example for restoring with --include-resources
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-12 16:36:39 -04:00
Nolan Brubaker c326f59627 Prepend velero.io to non-namespaced names
Prior to 1.0, user-provided values such as cloud provider names didn't
need to be namespaced. This change allows those values to continue
working without the user editing the fields manually.

Fixes #1363

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-12 16:31:16 -04:00
Steve Kriss 3116185e5b instantiate plugin manager with per-restore logger so plugin logs are captured
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-12 10:36:20 -06:00
KubeKween abee09aa2d Add validation for plugin name format and dups (#1339)
* Add validation for plugin name format and dups

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

* Bug fix

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

* Add changelog

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

* Address code reviews

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

* Fix code

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

* Address code reviews

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

* Add documentation

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

* Update godoc

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

* More doc

Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-12 08:25:04 -06:00
Aman Wangde 0e0f357cef Added ability to disable controllers (#1326)
Signed-off-by: James King <james.king@emc.com>
2019-04-10 15:41:28 -04:00
Steve Kriss 23c0d3f612
Merge pull request #1352 from rohandvora/default-backup-ttl
Set default backup TTL
2019-04-09 15:34:32 -06:00
Rohan Vora 4beb8aab3c Set default backup TTL
Set default backup TTL to 30 days when TTL
is not provided in the backup yaml configuration.

Updates #138

Signed-off-by: Rohan Vora <vorar@vmware.com>
2019-04-09 14:13:29 -07:00
KubeKween 13eaad0e64 Refactor protobuf (#1354)
* Update protobuffs

Signed-off-by: Carlisia <carlisiac@vmware.com>
2019-04-09 13:50:05 -04:00
Steve Kriss 956152d6e1
Merge pull request #1355 from nrb/backup-examples
Add examples to backup create command
2019-04-09 08:15:00 -06:00
Nolan Brubaker bca21a1ec0 Add examples to backup create command
Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2019-04-05 14:40:05 -04:00
Steve Kriss 2f47ca62ad always allow 'bucket' as a config key for object stores (#1349)
Signed-off-by: Steve Kriss <krisss@vmware.com>
2019-04-05 11:24:55 -07:00
sseago a519547efc Adds support for allowing a RestoreItemAction to skip item restore (#1336)
* Adds support for allowing a RestoreItemAction to skip item restore

This allows a RestoreItemAction plugin to signal to velero that
the returned item should be skipped rather than restored to the
cluster.

To support this, a boolean SkipRestore attribute is added to
RestoreItemActionExecuteOutput. If restore.restoreResource finds
this set to true, any remaining actions on this item are skipped,
and restore on this item is skipped. Execution continues with
the next item of this resource type.

To signal this for a particular item, the RestoreItemAction's
Execute method should call WithoutRestore() on the
RestoreItemActionExecuteOutput before returning it.

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

* Autogenerated code to support SkipRestore

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

* Added changelog for #1336

Signed-off-by: Scott Seago <sseago@redhat.com>
2019-04-04 13:39:54 -06:00
Fábio Franco Uechi 0167539a14 add new counter metrics for backup deletion (#1280)
* compute backup deletion metrics (attempt, success, fail)

Signed-off-by: fabito <fuechi@ciandt.com>
2019-04-04 14:25:59 -04:00
Steve Kriss 2e3f00f64d
Merge pull request #1340 from carlisia/c-copy
Fix copyright
2019-04-01 15:49:06 -06:00
Nolan Brubaker c3a933d3e3
Merge pull request #1338 from skriss/validate-config-keys
objectstores/volumesnapshotters: check for invalid keys in config
2019-04-01 15:11:15 -04:00