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

kubectl rollout undo deployment without further parameters (affecting all resources) functionality #72747

Open
hawran opened this Issue Jan 9, 2019 · 7 comments

Comments

Projects
None yet
4 participants
@hawran
Copy link

hawran commented Jan 9, 2019

/sig cli

What would you like to be added:
Hi,
today I've accidentally run the command as follows:
kubectl rollout undo deployment
- I unintentionally omitted a name of my deployment - and all deployments have been undo-ed, :-/.

I'd expect an explicit parameter (a confirm question?) here.

Why is this needed:
I'd say there should be an explicit parameter (a confirm question?) with such "destructive" commands affecting all resources (= when there's no the particular name of a resource).
I don't think the --dry-run parameter is appropriate in this use case.

PS Does the delete command work the same way?

Supplement:

kubectl version
Client Version: version.Info{Major:"1", Minor:"12+", GitVersion:"v1.12.4-dirty", GitCommit:"f49fa022dbe63faafd0da106ef7e05a29721d3f1", GitTreeState:"dirty", BuildDate:"2018-12-18T07:57:52Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.6", GitCommit:"a21fdbd78dde8f5447f5f6c331f7eb6f80bd684e", GitTreeState:"clean", BuildDate:"2018-07-26T10:04:08Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
@smarterclayton

This comment has been minimized.

Copy link
Contributor

smarterclayton commented Jan 10, 2019

Rollout undo should require —all to be used on all deployments, like other destructive commands (delete, apply)

@Zyqsempai

This comment has been minimized.

Copy link
Contributor

Zyqsempai commented Jan 10, 2019

I can take it.
Just let's clarify the behavior.
kubectl rollout undo deployment --all should undo all deployments
kubectl rollout undo deployment should return a message something like "Please specify deployment or use the --all flag"

@hawran

This comment has been minimized.

Copy link

hawran commented Jan 10, 2019

I can take it.
Just let's clarify the behavior.
kubectl rollout undo deployment --all should undo all deployments
kubectl rollout undo deployment should return a message something like "Please specify deployment or use the --all flag"

Yes, I imagined something like this.
Just to be sure, is it expected behaviour for all "destructive" commands, delete for instance?

@Zyqsempai

This comment has been minimized.

Copy link
Contributor

Zyqsempai commented Jan 10, 2019

Yes, delete has --all flag, and will do nothing without specified resource.

@Zyqsempai

This comment has been minimized.

Copy link
Contributor

Zyqsempai commented Jan 10, 2019

Here is the message from delete "resource(s) were provided, but no name, label selector, or --all flag specified"
I will go with same for undo

@hawran

This comment has been minimized.

Copy link

hawran commented Jan 10, 2019

I see, OK then.

@hawran

This comment has been minimized.

Copy link

hawran commented Jan 17, 2019

Thank you,
haw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment