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

Require confirmation if rolling back more than 9 releases #975

Merged
merged 2 commits into from
Aug 18, 2016

Conversation

Nosajool
Copy link
Contributor

Fixes #881

$ EMPIRE_API_URL=http://$(docker-machine ip default):8080 ./build/emp rollback v1 -a acme-inc
WARNING. Attempting to rollback 18 versions from v19 to v1.
To proceed, type v1: v1
Rolled back acme-inc to v1 as v20.
$ EMPIRE_API_URL=http://$(docker-machine ip default):8080 ./build/emp rollback v1 -a acme-inc
WARNING. Attempting to rollback 19 versions from v20 to v1.
To proceed, type v1: v19
Rollback confirmation did not match.

var vconfirmation string
fmt.Printf("WARNING. Attempting to rollback %d versions from v%d to v%d.\n", diff, currVer, verNum)
fmt.Printf("To proceed, type v%d: ", verNum)
fmt.Scanln(&vconfirmation)
Copy link
Contributor

Choose a reason for hiding this comment

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

You could probably re-use the mustConfirm helper here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, perfect

@ejholmes
Copy link
Contributor

Awesome. Other than those comments, this looks great.

P.S. CI might fail right now because of #972

@ejholmes ejholmes merged commit 38f1028 into master Aug 18, 2016
@ejholmes ejholmes deleted the jl-safer-rollback branch August 18, 2016 23:54
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.

None yet

2 participants