-
Notifications
You must be signed in to change notification settings - Fork 99
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 confirm mechanism when delete or update action #372
base: master
Are you sure you want to change the base?
Add confirm mechanism when delete or update action #372
Conversation
ba7141a
to
62cab2f
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.
I disagree with this change as would force a current user to always use this new flag when deleting entity.
One example of a more popular CLI is Kubernetes and it doesn’t require a flag to delete
https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#delete
Top level program calling CLI can do this check
You can extend/fork the code and create your own customized of the CLI (IBM already does with ibm wsk ...)
What about adding a |
this appears to be a breaking change as it is currently implemented. if so, i'm not in favor of this change as implemented. one possible implementation is to use an env variable, say WSK_CLI_SAFE_MODE or WSK_CLI_ACTION_MGMT_SAFE_MODE or..., that when set will cause the cli to always prompt for confirmation of action deletes/updates. when env is not present, the current behavior remains. no need for additional command line flag. |
I like the suggestions. Could also store it in whisk properties. |
yep I like the using environment variable. |
@csantanapr , thanks for your reply. |
|
@mdeuser so you mean |
62cab2f
to
8294483
Compare
A property saved in wskprops would address the environment issue since switching files will then configure the cli as desired. We have no precedent for an env file that changes the cli behavior outside of WSK_CONFIG_FILE so a stand-alone property to me for this behavior seems like the wrong direction. |
8294483
to
247866e
Compare
@rabbah ,already modified. The patch implement the protect feature at CLI layer. How about add the protect mechanism at the backed server layer also? But i am afraid that if added in backed server layer, may lead to client side do huge breakpoint. |
On the backend I think the model is finer grained entitlement than we have today, with unix style permissions. |
commands/flags.go
Outdated
apihostSet string | ||
apiversionSet string | ||
namespaceSet string | ||
promptOnChangeSet 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.
can this be a boolean flag? i.e. the present of --confirm
(typical practice in other clis use --force
) indicates the desire to override the confirmation.
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.
Already modified
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.
This will also need unit tests (go unit tests preferably).
I think a prompt would be better than an additional flag. |
@rabbah , so we have no need to add the protect mechanism for backend layer, right? |
f6017df
to
b63643e
Compare
If by prompt you mean something interactive which requires input on the console then this will make it very inconvenient to actually update a namespace when it is so intended. |
7a1a4c5
to
d84129f
Compare
As more and more production system uses openwhisk, Users will need some feature to protect their action to be deleted or updated by mistake.
d84129f
to
33b6054
Compare
@rabbah ,already added test cases. Regarding So one option is, add If we add |
Please don't merge this patch |
I writed a issue here: #371
As more and more production system uses openwhisk,
Users will need some feature to protect their action to be
deleted or updated by mistake.