From fb2aab1911ac51f4bd8ac2288ae475118b003051 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Jacquier <15922119+pierre-emmanuelJ@users.noreply.github.com> Date: Fri, 19 Jul 2024 14:32:59 +0000 Subject: [PATCH] fixup! Not found error Signed-off-by: Pierre-Emmanuel Jacquier <15922119+pierre-emmanuelJ@users.noreply.github.com> --- cmd/instance_delete.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/instance_delete.go b/cmd/instance_delete.go index eaa33d62..01f734d2 100644 --- a/cmd/instance_delete.go +++ b/cmd/instance_delete.go @@ -54,10 +54,10 @@ func (c *instanceDeleteCmd) cmdRun(_ *cobra.Command, _ []string) error { for _, i := range c.Instances { instance, err := instances.FindListInstancesResponseInstances(i) if err != nil { - fmt.Fprintf(os.Stderr, "warning: %s not found.\n", i) if !c.Force { return err } + fmt.Fprintf(os.Stderr, "warning: %s not found.\n", i) continue } @@ -88,6 +88,8 @@ func (c *instanceDeleteCmd) cmdRun(_ *cobra.Command, _ []string) error { return err } + // Cleaning up resources created in create instance + // https://github.com/exoscale/cli/blob/master/cmd/instance_create.go#L220 for _, i := range instanceToDelete { instanceDir := path.Join(globalstate.ConfigFolder, "instances", i.String()) if _, err := os.Stat(instanceDir); !os.IsNotExist(err) {