mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
Do not necessarily error out if odo dev is stopped via Ctrl+C (#6917)
* Add test highlighting the expectations * Propagate errors and call os.Exit only in 'main' functions See ExitInMain[1] and ExitInMain_ExitOnce[2] coding convention guidelines. [1] https://github.com/redhat-developer/odo/wiki/Dev:-Coding-Conventions#exit-in-main [2] https://github.com/redhat-developer/odo/wiki/Dev:-Coding-Conventions#exit-once * Handle errors returned by Cleanuper#Cleanup This makes sure the exit code of the command is mapped onto any error returned by Cleanup * Do not return an error when the watch loop in 'odo dev' is interrupted * Test that the exit code of 'odo dev' matches the error returned by the cleanup logic
This commit is contained in:
@@ -247,7 +247,11 @@ func handleWithRegistryExist(index int, registryList []Registry, operation strin
|
||||
|
||||
case "remove":
|
||||
if !forceFlag {
|
||||
if !ui.Proceed(fmt.Sprintf("Are you sure you want to %s registry %q", operation, registryName)) {
|
||||
proceed, err := ui.Proceed(fmt.Sprintf("Are you sure you want to %s registry %q", operation, registryName))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !proceed {
|
||||
log.Info("Aborted by the user")
|
||||
return registryList, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user