acoustic-carpenter-78188
08/23/2023, 6:40 PMupdate commands like flytectl update cluster-resource-attribute it's really easy to inadvertently override existing values. For commands that are mutating/destructive where update acts as an insert or an upsert, we should require an interactive user ACK or --force flag to ensure these changes are explicit.
For scope, see commands at https://github.com/flyteorg/flytectl/tree/master/cmd/update
Note, this is a breaking change for non-interactive scripts. They would need to be updated to pass --force.
Expected work
1. Identify subset of commands that act as insert or upsert and require an ACK
2. For each, query the current value, and if one exists, request positive confirmation of the change from the user
3. Add an optional --force flag to bypass the interactive confirmation in (2). This allows for usage of flytectl in scripts
Provide a possible output or UX example
> flytectl update cluster-resource-attribute --attrFile cra.yaml
Found existing cluster resource attribute for project 'flytesnacks', domain 'development'.
Are you sure you want to overwrite [y/N]?
y
> flytectl update cluster-resource-attribute --attrFile cra.yaml --force
Are you sure this issue hasn't been raised already?
☑︎ Yes
Have you read the Code of Conduct?
☑︎ Yes
flyteorg/flyte