Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Add volume snapshots feature #331

Merged
merged 15 commits into from
Sep 7, 2017

Conversation

tsmetana
Copy link
Contributor

@tsmetana tsmetana commented Sep 1, 2017

This patch set adds code for the volume snapshots support. The code comes from github.com/rootfs/snapshot master branch. In order to make the new code compile there are updated vendor dependencies. I have also modified the Makefile by adding new target for snapshots and also traditional "all" target to compile everything in the tree.

cc: @rootfs

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 1, 2017
@tsmetana
Copy link
Contributor Author

tsmetana commented Sep 1, 2017

Sorry for the failed tests. Will fix that.

@wongma7
Copy link
Contributor

wongma7 commented Sep 1, 2017

@tsmetana given how excessive/annoying golint can be, I am going to look into copying upstreams hack/.golint_failures so that we can exempt snapshots from it

@tsmetana
Copy link
Contributor Author

tsmetana commented Sep 4, 2017

OK. Thank you. I will fix the easy ones (gofmt) and the "errors" ignoring the "warnings" for the moment.

@wongma7
Copy link
Contributor

wongma7 commented Sep 5, 2017

i've opened kubernetes/repo-infra#43, if nobody responds today I'll just patch our repo-infra myself

@wongma7
Copy link
Contributor

wongma7 commented Sep 5, 2017

okay, patched
rebase onto master, then add a line snapshots or lines snapshots/foo snapshots/bar to a new file .golintignore at the root of external-storage, and golint will stop complaining.

@tsmetana
Copy link
Contributor Author

tsmetana commented Sep 6, 2017

OK... I definitely must not have done that correctly.

@wongma7
Copy link
Contributor

wongma7 commented Sep 6, 2017

no, it's working, golint isn't running on snapshots anymore. But there's deadcode, vetshadow and gocyclo, which I don't think upstream runs hence the errors

@wongma7
Copy link
Contributor

wongma7 commented Sep 6, 2017

I think upstream only runs govet, of the four gometalinters https://github.com/kubernetes-incubator/external-storage/blob/master/repo-infra/verify/go-tools/verify-gometalinter.sh

have to wonder why repo-infra imposes stricter requirements than upstream but oh well. I guess there needs to be a way to skip not just golint but the other ones too, I will work on it.

@wongma7
Copy link
Contributor

wongma7 commented Sep 6, 2017

k, #342 is merged. next tests should pass...

Copy link
Contributor

@wongma7 wongma7 left a comment

Choose a reason for hiding this comment

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

one comment only, lgtm

}
prId := string(uuid.NewUUID())
if *id != "" {
prId = *id
Copy link
Contributor

Choose a reason for hiding this comment

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

We should default to provisionerName instead of generating every start up like https://github.com/kubernetes-incubator/external-storage/blob/master/ceph/rbd/cmd/rbd-provisioner/main.go#L67

this means Delete will succeed from any instance of the provisioner with same provisionername, I assume that is safe.

}
}

return fmt.Errorf("Snapshot %s is NOT completed successfully.", snapshotName)
Copy link
Contributor

Choose a reason for hiding this comment

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

CI govet says unreachable code, we will never break out of the above loop

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's intentional. The offending method is being called from a goroutine that actually is meant to either succeed or fail... And wait forever when none of that happens.

Copy link
Contributor

Choose a reason for hiding this comment

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

okay, can safely remove this line then

@wongma7
Copy link
Contributor

wongma7 commented Sep 7, 2017

need boilerplate :( can run make verify locally to see what the ci is complaining about.

Will merge asap afterwards :)

@wongma7
Copy link
Contributor

wongma7 commented Sep 7, 2017

merging, pls consider #331 (comment) at a later date, a new identity every time means if the snapshot provisioner restarts it will avoid deleting old snapshots which is maybe overly cautious

@wongma7 wongma7 added the lgtm Indicates that a PR is ready to be merged. label Sep 7, 2017
@wongma7 wongma7 merged commit f4aa98b into kubernetes-retired:master Sep 7, 2017
@tsmetana
Copy link
Contributor Author

tsmetana commented Sep 8, 2017

Thanks. I'll take a look at the provisioner name.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants