-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add missing features to snapshot restore/pop #6879
Add missing features to snapshot restore/pop #6879
Conversation
In our test environments, it's good to be able to roll back to the same, anonymous, snapshot repeatedly. This patch adds a `--no-delete` option to the `snapshot pop` command allowing this. This makes the new core snapshot behaviour more consistent with what we were doing with vagrant-multiprovider-snap (https://github.com/scalefactory/vagrant-multiprovider-snap)
I've also added a patch to allow the provisioning flags (available with the |
We talked about this on the other issue and I agree that it would require a semver boundary to adjust the default behavior, even if it wasn't correct (since snapshot was not considered a preview). |
snapshot_name = "push_#{Time.now.to_i}_#{rand(10000)}" | ||
|
||
# Save the snapshot. This will raise an exception if it fails. | ||
machine.action(:snapshot_save, snapshot_name: snapshot_name) | ||
end | ||
|
||
def pop(machine) | ||
def pop(machine,opts={}) |
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.
Style nit - comma space on all these args.
LGTM - thanks @jtopper! |
Add missing features to snapshot restore/pop
Update website docs for #6879
In case anyone else ends up here the same way I did: It looks like updates to the docs have been released prematurely. As I write this they mention the new $ vagrant --version
Vagrant 1.8.1
$ vagrant snapshot restore --help
Usage: vagrant snapshot restore [options] [vm-name] <name>
Restore a snapshot taken previously with snapshot save.
-h, --help Print this help Happy to find that --no-provision is coming though! |
In our test environments, it's good to be able to roll back to the same,
anonymous, snapshot repeatedly. This patch adds a
--no-delete
optionto the
snapshot pop
command allowing this.This makes the new core snapshot behaviour more consistent with what we
were doing with vagrant-multiprovider-snap which I intend to deprecate eventually.