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

Invalid restic repo prefix when using custom object store plugin #939

Closed
bashofmann opened this issue Oct 16, 2018 · 5 comments · Fixed by #1742
Closed

Invalid restic repo prefix when using custom object store plugin #939

bashofmann opened this issue Oct 16, 2018 · 5 comments · Fixed by #1742
Labels
Restic Relates to the restic integration
Milestone

Comments

@bashofmann
Copy link
Contributor

What steps did you take and what happened:
When you have a custom object store plugin configured, the getRepoPrefix (https://github.com/heptio/ark/blob/master/pkg/restic/config.go#L43-L79) method returns an invalid restic repo string and there is no way to configure ark in a way to get a valid one because prefix will remain empty.

This results in the following error message when creating a backup with restic:

 error running command=restic init --repo=:metakube-cluster-backup-fhgbvx65xg-restic:/backup-tutorial --password-file=/tmp/ark-restic-credentials-backup-tutorial462685577 --cache-dir=/scratch/.cache/restic, stdout=, stderr=Fatal: create repository at :metakube-cluster-backup-fhgbvx65xg-restic:/backup-tutorial failed: invalid backend
    If the repo is in a local directory, you need to add a `local:` prefix

What did you expect to happen:
There should be a way to configure ark to produce a valid restic repo string.

Environment:

  • Ark version (use ark version): 0.9.7
  • Kubernetes version (use kubectl version): 1.11.3
@ncdc
Copy link
Contributor

ncdc commented Oct 16, 2018

@bashofmann thanks for the report! What kind of object store plugin are you using?

@bashofmann
Copy link
Contributor Author

Basically the s3 object store but with a different signer because of #811.

A potential patch for this could be

--- a/pkg/restic/config.go
+++ b/pkg/restic/config.go
@@ -73,6 +73,8 @@ func getRepoPrefix(config arkv1api.ObjectStorageProviderConfig) string {
                prefix = "azure"
        case GCPBackend:
                prefix = "gs"
+       default:
+               return config.ResticLocation
        }

        return fmt.Sprintf("%s:%s:/%s", prefix, bucket, path)

@ncdc
Copy link
Contributor

ncdc commented Oct 16, 2018

Ok thanks for the info. Another possible option would be to add a method to the BlockStore plugin interface to allow it to return this information. But if your proposed patch works for you, we could certainly start there.

@skriss wdyt?

@skriss
Copy link
Contributor

skriss commented Oct 16, 2018

yeah, I think making this an optional key in the config makes sense. It would be part of a BackupStorageLocation a/o v0.10.

@bashofmann
Copy link
Contributor Author

Tested it and the above patch with configuring the full restic location (s3:https:/.../bucket) works for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Restic Relates to the restic integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants