Skip to content

Commit

Permalink
Applying timeout on conainer stop
Browse files Browse the repository at this point in the history
  • Loading branch information
FlUxIuS committed Dec 4, 2024
1 parent 31e6265 commit 030d8d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go/rfswift/dock/rfdock.go
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,7 @@ func showLoadingIndicator(ctx context.Context, commandFunc func() error, stepNam
}

func UpdateMountBinding(containerName string, source string, target string, add bool) {
var timeout = 10
ctx := context.Background()

common.PrintInfoMessage("Fetching container ID...")
Expand All @@ -1603,7 +1604,8 @@ func UpdateMountBinding(containerName string, source string, target string, add
os.Exit(1)
}
common.PrintInfoMessage("Stopping the container...")
err = cli.ContainerStop(ctx, containerID, container.StopOptions{})

err = cli.ContainerStop(ctx, containerID, container.StopOptions{Timeout: &timeout})
if err != nil {
common.PrintErrorMessage(fmt.Errorf("Failed to stop the container"))
os.Exit(1)
Expand Down

0 comments on commit 030d8d5

Please sign in to comment.