-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat(velero): velero plugin for backup and restore for ZFS-LocalPV #102
Conversation
335aefb
to
cc0daab
Compare
2a866a2
to
b3b1ed7
Compare
516b89d
to
feb78f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. Given few comments about formatting.
pkg/zfs/plugin/backup.go
Outdated
} | ||
|
||
func (p *Plugin) createBackup(vol *apis.ZFSVolume, schdname, snapname string) (string, error) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: unnecessary leading newline
pkg/zfs/plugin/restore.go
Outdated
) | ||
|
||
func (p *Plugin) createVolume(pvname string, bkpname string, bkpZV *apis.ZFSVolume) (*apis.ZFSVolume, error) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: unnecessary new line
pkg/zfs/plugin/restore.go
Outdated
} | ||
|
||
func (p *Plugin) checkRestoreStatus(snapname string) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: unnecessary new line
pkg/zfs/plugin/restore.go
Outdated
} | ||
|
||
func (p *Plugin) restoreZFSVolume(pvname, bkpname string) (*apis.ZFSVolume, error) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: unnecessary new line
pkg/zfs/plugin/restore.go
Outdated
|
||
func (p *Plugin) checkRestoreStatus(snapname string) { | ||
|
||
for true { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for true { | |
for { |
pkg/zfs/plugin/restore.go
Outdated
var vol *apis.ZFSVolume = nil | ||
|
||
if len (volList.Items) > 1 { | ||
return nil, errors.Errorf("zfs: error can not have more than one source volume %s", pvname, bkpname) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing indentifier for bkpname
in Errorf
.
A new provider(openebs.io/zfspv-blockstore) has been added to support backup and restore for ZFS-LocalPV. We can use below VolumeSnapshotLocation to backup/restore the data to/from the cloud. ```yaml apiVersion: velero.io/v1 kind: VolumeSnapshotLocation metadata: name: default namespace: velero spec: provider: openebs.io/zfspv-blockstore config: bucket: velero prefix: zfs namespace: openebs provider: aws region: minio s3ForcePathStyle: "true" s3Url: http://minio.velero.svc:9000 ``` Signed-off-by: Pawan <pawan@mayadata.io>
Signed-off-by: Pawan <pawan@mayadata.io>
Signed-off-by: Pawan <pawan@mayadata.io>
Signed-off-by: Pawan <pawan@mayadata.io>
eb6658d
to
685b955
Compare
Signed-off-by: Pawan <pawan@mayadata.io>
@@ -83,7 +83,7 @@ all: build | |||
container: all | |||
@echo ">> building container" | |||
@cp Dockerfile _output/Dockerfile | |||
docker build -t $(IMAGE):$(IMAGE_TAG) ${DBUILD_ARGS} -f _output/Dockerfile _output | |||
@sudo docker build -t $(IMAGE):$(IMAGE_TAG) ${DBUILD_ARGS} -f _output/Dockerfile _output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these changes really required? sudo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, needed for docker.
Why is this PR required? What issue does it fix?:
Adding backup and restore support for ZFS-LocalPV. The PR in the ZFS-LocalPV repo is here : openebs/zfs-localpv#162
What this PR does?:
A new provider(openebs.io/zfspv-blockstore) has been added to
support backup and restore for ZFS-LocalPV. We can use below
VolumeSnapshotLocation to backup/restore the data to/from the cloud.
Does this PR require any upgrade changes?:
no
If the changes in this PR are manually verified, list down the scenarios covered and commands you used for testing with logs:
test case: backup the full namespace, delete it, and restore it and verify the data.
Any additional information for your reviewer?:
I am using local repo in go mod as ZFS-LocalPV side changes are not merged. Will update that once changes are merged.
github.com/openebs/zfs-localpv => /home/pawan/Desktop/openebs/src/github.com/openebs/zfs-localpv
To Do:
There are few changes related to it in this PR, will support the full incremental backup and restore after PR #99
Checklist:
<type>(<scope>): <subject>