File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
modal-go/examples/sandbox-image-mount Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -103,8 +103,12 @@ func main() {
103103 if err != nil {
104104 log .Fatalf ("Failed to create second Sandbox: %v" , err )
105105 }
106+ sb2FromID , err := mc .Sandboxes .FromID (ctx , sb2 .SandboxID )
107+ if err != nil {
108+ log .Fatalf ("Failed to create Sandbox: %v" , err )
109+ }
106110 defer func () {
107- if _ , err := sb2 .Terminate (context .Background (), nil ); err != nil {
111+ if _ , err := sb2FromID .Terminate (context .Background (), nil ); err != nil {
108112 log .Fatalf ("Failed to terminate Sandbox %s: %v" , sb2 .SandboxID , err )
109113 }
110114 }()
@@ -134,6 +138,10 @@ func main() {
134138 }
135139 fmt .Printf ("Contents of /repo directory in new Sandbox sb2:\n %s" , output )
136140
141+ if _ , err := sb2 .Terminate (ctx , nil ); err != nil {
142+ log .Fatalf ("Failed to terminate sb2: %v" , err )
143+ }
144+
137145 if err := mc .Images .Delete (ctx , repoSnapshot .ImageID , nil ); err != nil {
138146 log .Fatalf ("Failed to delete snapshot image: %v" , err )
139147 }
You can’t perform that action at this time.
0 commit comments