@@ -36,14 +36,16 @@ instead, stop the emulator and run "lstk volume clear".`,
3636 return fmt .Errorf ("failed to get config: %w" , err )
3737 }
3838
39- var awsContainer * config.ContainerConfig
40- for i , c := range appConfig .Containers {
39+ var awsContainer config.ContainerConfig
40+ var found bool
41+ for _ , c := range appConfig .Containers {
4142 if c .Type == config .EmulatorAWS {
42- awsContainer = & appConfig .Containers [i ]
43+ awsContainer = c
44+ found = true
4345 break
4446 }
4547 }
46- if awsContainer == nil {
48+ if ! found {
4749 return errors .New ("reset is only supported for the AWS emulator" )
4850 }
4951
@@ -59,12 +61,10 @@ instead, stop the emulator and run "lstk volume clear".`,
5961 host , _ := endpoint .ResolveHost (cmd .Context (), awsContainer .Port , cfg .LocalStackHost )
6062 resetter := aws .NewClient ()
6163
62- containers := []config.ContainerConfig {* awsContainer }
63-
6464 if interactive {
65- return ui .RunReset (cmd .Context (), rt , containers , resetter , host , force )
65+ return ui .RunReset (cmd .Context (), rt , []config. ContainerConfig { awsContainer } , resetter , host , force )
6666 }
67- return reset .Reset (cmd .Context (), rt , containers , resetter , host , force , output .NewPlainSink (os .Stdout ))
67+ return reset .Reset (cmd .Context (), rt , []config. ContainerConfig { awsContainer } , resetter , host , force , output .NewPlainSink (os .Stdout ))
6868 },
6969 }
7070
0 commit comments