Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create backups from schedules using velero create backup #1734

Merged

Conversation

prydonius
Copy link
Contributor

Adds a flag --from-schedule to the velero create backup command to create a Backup from an existing Schedule.

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

closes #656

…schedules

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
pkg/cmd/cli/backup/create.go Outdated Show resolved Hide resolved
pkg/cmd/cli/backup/create.go Outdated Show resolved Hide resolved
Copy link
Contributor

@nrb nrb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple questions, but I think I'd like to see some behavior documented either way.

pkg/builder/object_meta.go Show resolved Hide resolved
pkg/cmd/cli/backup/create.go Outdated Show resolved Hide resolved
@prydonius
Copy link
Contributor Author

FYI I think this should wait for v1.2, but just wanted to get something going.

Adnan Abdulhussein added 2 commits August 6, 2019 15:01
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
@nrb nrb added this to the v1.2 milestone Aug 6, 2019
Adnan Abdulhussein added 4 commits August 6, 2019 15:27
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
Adnan Abdulhussein added 2 commits August 19, 2019 18:05
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
Adnan Abdulhussein added 2 commits August 22, 2019 14:25
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
@prydonius
Copy link
Contributor Author

I updated the flag description and added a basic test for building backups, and some tests for building backups from schedules. I couldn't see a clear way to create a table-driven test here, feedback welcome!

@@ -0,0 +1,89 @@
/*
Copyright 2017 the Velero contributors.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2019

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, the generator just takes the header from the main file, so I forgot to update it!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I would like to automate this away someday.

@skriss
Copy link
Member

skriss commented Aug 22, 2019

two nits, otherwise LGTM. tests LGTM as-is -- IMHO when there are only a small number of cases, there's not that much benefit to using table-driven. Gets more useful when lots of scenarios.

@skriss
Copy link
Member

skriss commented Aug 22, 2019

I think you need a make update as well

Signed-off-by: Adnan Abdulhussein <aadnan@vmware.com>
@@ -33,7 +33,7 @@ import (
"k8s.io/client-go/tools/cache"

api "github.com/heptio/velero/pkg/apis/velero/v1"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skriss looks like this used to have a duplicate package import too, should I update this to use velerov1api everywhere too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, let's get this one merged - we can update this next time we touch this file.

Copy link
Member

@skriss skriss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@carlisia carlisia merged commit 6aa0215 into vmware-tanzu:master Aug 23, 2019
@prydonius prydonius deleted the 656-create-backup-from-schedule branch August 23, 2019 20:26
jessestuart added a commit to jessestuart/velero that referenced this pull request Aug 28, 2019
* upstream/master: (118 commits)
  restore: rename PV when remapping a namespace if PV exists in-cluster (vmware-tanzu#1779)
  when backing up PVCs with restic, explicitly specify --parent (vmware-tanzu#1807)
  Unit tests for restic restore (vmware-tanzu#1747)
  Upgrade kubernetes dependencies to 1.15.3 (vmware-tanzu#1808)
  create backups from schedules using velero create backup (vmware-tanzu#1734)
  remove calls to restic check before/after prune (vmware-tanzu#1794)
  Propose adding feature flags to velero
  restic backup and restore progress proposal (vmware-tanzu#1765)
  allow custom restic repo prefix to be specified in BSL config
  error if restic repo identifier can't be determined
  update nokogiri dep for website
  update links on website home page for latest release (vmware-tanzu#1789)
  Velero 1.1 blog post
  v1.1.0 changelog
  fix error formatting
  Revert "allow self signed certs with insecureSkipVerify (vmware-tanzu#1769)"
  allow self signed certs with insecureSkipVerify (vmware-tanzu#1769)
  v1.1.0 docs
  Add the prefix to BSL config map so that object stores can use it when initializing (vmware-tanzu#1767)
  add stable/velero to helm commands
  ...
jessestuart added a commit to jessestuart/velero that referenced this pull request Aug 28, 2019
* upstream/master: (118 commits)
  restore: rename PV when remapping a namespace if PV exists in-cluster (vmware-tanzu#1779)
  when backing up PVCs with restic, explicitly specify --parent (vmware-tanzu#1807)
  Unit tests for restic restore (vmware-tanzu#1747)
  Upgrade kubernetes dependencies to 1.15.3 (vmware-tanzu#1808)
  create backups from schedules using velero create backup (vmware-tanzu#1734)
  remove calls to restic check before/after prune (vmware-tanzu#1794)
  Propose adding feature flags to velero
  restic backup and restore progress proposal (vmware-tanzu#1765)
  allow custom restic repo prefix to be specified in BSL config
  error if restic repo identifier can't be determined
  update nokogiri dep for website
  update links on website home page for latest release (vmware-tanzu#1789)
  Velero 1.1 blog post
  v1.1.0 changelog
  fix error formatting
  Revert "allow self signed certs with insecureSkipVerify (vmware-tanzu#1769)"
  allow self signed certs with insecureSkipVerify (vmware-tanzu#1769)
  v1.1.0 docs
  Add the prefix to BSL config map so that object stores can use it when initializing (vmware-tanzu#1767)
  add stable/velero to helm commands
  ...
jessestuart added a commit to jessestuart/velero that referenced this pull request Aug 28, 2019
* upstream/master: (118 commits)
  restore: rename PV when remapping a namespace if PV exists in-cluster (vmware-tanzu#1779)
  when backing up PVCs with restic, explicitly specify --parent (vmware-tanzu#1807)
  Unit tests for restic restore (vmware-tanzu#1747)
  Upgrade kubernetes dependencies to 1.15.3 (vmware-tanzu#1808)
  create backups from schedules using velero create backup (vmware-tanzu#1734)
  remove calls to restic check before/after prune (vmware-tanzu#1794)
  Propose adding feature flags to velero
  restic backup and restore progress proposal (vmware-tanzu#1765)
  allow custom restic repo prefix to be specified in BSL config
  error if restic repo identifier can't be determined
  update nokogiri dep for website
  update links on website home page for latest release (vmware-tanzu#1789)
  Velero 1.1 blog post
  v1.1.0 changelog
  fix error formatting
  Revert "allow self signed certs with insecureSkipVerify (vmware-tanzu#1769)"
  allow self signed certs with insecureSkipVerify (vmware-tanzu#1769)
  v1.1.0 docs
  Add the prefix to BSL config map so that object stores can use it when initializing (vmware-tanzu#1767)
  add stable/velero to helm commands
  ...
jessestuart added a commit to jessestuart/velero that referenced this pull request Aug 28, 2019
* jesse/20190828_merge: (511 commits)
  fix(ci): Update arm32 target.
  feat(ci): Auto-build restic-restore-helper image in CI.
  restore: rename PV when remapping a namespace if PV exists in-cluster (vmware-tanzu#1779)
  when backing up PVCs with restic, explicitly specify --parent (vmware-tanzu#1807)
  Unit tests for restic restore (vmware-tanzu#1747)
  Upgrade kubernetes dependencies to 1.15.3 (vmware-tanzu#1808)
  create backups from schedules using velero create backup (vmware-tanzu#1734)
  remove calls to restic check before/after prune (vmware-tanzu#1794)
  Propose adding feature flags to velero
  restic backup and restore progress proposal (vmware-tanzu#1765)
  allow custom restic repo prefix to be specified in BSL config
  error if restic repo identifier can't be determined
  update nokogiri dep for website
  update links on website home page for latest release (vmware-tanzu#1789)
  Velero 1.1 blog post
  v1.1.0 changelog
  fix error formatting
  Revert "allow self signed certs with insecureSkipVerify (vmware-tanzu#1769)"
  allow self signed certs with insecureSkipVerify (vmware-tanzu#1769)
  v1.1.0 docs
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFE: Create backup from schedule
4 participants