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

Use ResticRepository's resticIdentifier field as the source of truth for repo IDs #557

Merged
merged 1 commit into from
Jun 20, 2018

Conversation

skriss
Copy link
Contributor

@skriss skriss commented Jun 15, 2018

Builds on #532 , only the last commit is new.

This PR:

  • replaces the RepoPrefix field on PodVolumeBackup and PodVolumeRestore with a RepoIdentifier field, which contains the full restic repo identifier (populated by the Ark server by pulling from the relevant ResticRepository CR)
  • removes the global repoPrefix field from the pkg/restic/repositoryManager and instead sources repos' identifiers from the ResticRepository CRs (paving the way for supporting heterogeneous restic backends - no need for them all to be the same, or to be AWS/Azure/GCP anymore)
  • checks for a ready repo before trying to create/run a PodVolumeRestore, similarly to for backups

@skriss skriss force-pushed the move-repo-id-source branch 2 times, most recently from d211da2 to cf52df8 Compare June 15, 2018 21:25
@skriss skriss requested a review from ncdc June 15, 2018 22:54
@skriss skriss requested a review from nrb June 15, 2018 22:54
@ncdc
Copy link
Contributor

ncdc commented Jun 19, 2018

last commit lgtm

@skriss skriss force-pushed the move-repo-id-source branch from cf52df8 to f2072e5 Compare June 20, 2018 17:43
@skriss
Copy link
Contributor Author

skriss commented Jun 20, 2018

rebased, ready for merge.

@nrb nrb merged commit 4a7457e into vmware-tanzu:master Jun 20, 2018
@@ -84,22 +84,41 @@ func resultsKey(ns, name string) string {
return fmt.Sprintf("%s/%s", ns, name)
}

func getRepo(repoLister arkv1listers.ResticRepositoryLister, ns, name string) (*arkv1api.ResticRepository, error) {
repo, err := repoLister.ResticRepositories(ns).Get(name)
if apierrors.IsNotFound(err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we get any benefit by distinguishing the kind of error here?

@skriss skriss deleted the move-repo-id-source branch June 20, 2018 17:51
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.

3 participants