Skip to content

Commit b6edff4

Browse files
committed
updating based on feedback
1 parent 23cc4f7 commit b6edff4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

container.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ func (c *Client) InspectContainer(id string) (*Container, error) {
547547
// The context object can be used to cancel the inspect request.
548548
//
549549
// See https://goo.gl/FaI5JT for more details.
550-
func (c *Client) InspectContainerWithContext(ctx context.Context, id string) (*Container, error) {
550+
func (c *Client) InspectContainerWithContext(id string, ctx context.Context) (*Container, error) {
551551
return c.inspectContainer(id, doOptions{context: ctx})
552552
}
553553

@@ -817,7 +817,7 @@ func (c *Client) StartContainer(id string, hostConfig *HostConfig) error {
817817
// API 1.24 or greater.
818818
//
819819
// See https://goo.gl/fbOSZy for more details.
820-
func (c *Client) StartContainerWithContext(ctx context.Context, id string, hostConfig *HostConfig) error {
820+
func (c *Client) StartContainerWithContext(id string, hostConfig *HostConfig, ctx context.Context) error {
821821
return c.startContainer(id, hostConfig, doOptions{context: ctx})
822822
}
823823

@@ -857,7 +857,7 @@ func (c *Client) StopContainer(id string, timeout uint) error {
857857
// container request.
858858
//
859859
// See https://goo.gl/R9dZcV for more details.
860-
func (c *Client) StopContainerWithContext(ctx context.Context, id string, timeout uint) error {
860+
func (c *Client) StopContainerWithContext(id string, timeout uint, ctx context.Context) error {
861861
return c.stopContainer(id, timeout, doOptions{context: ctx})
862862
}
863863

container_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ func TestStartContainerWithContext(t *testing.T) {
10791079

10801080
startError := make(chan error)
10811081
go func() {
1082-
startError <- client.StartContainerWithContext(ctx, id, &HostConfig{})
1082+
startError <- client.StartContainerWithContext(id, &HostConfig{}, ctx)
10831083
}()
10841084
select {
10851085
case err := <-startError:
@@ -1154,7 +1154,7 @@ func TestStopContainerWithContext(t *testing.T) {
11541154

11551155
stopError := make(chan error)
11561156
go func() {
1157-
stopError <- client.StopContainerWithContext(ctx, id, 10)
1157+
stopError <- client.StopContainerWithContext(id, 10, ctx)
11581158
}()
11591159
select {
11601160
case err := <-stopError:
@@ -2729,7 +2729,7 @@ func TestInspectContainerWhenContextTimesOut(t *testing.T) {
27292729
ctx, cancel := context.WithTimeout(context.TODO(), 100*time.Millisecond)
27302730
defer cancel()
27312731

2732-
_, err := client.InspectContainerWithContext(ctx, "id")
2732+
_, err := client.InspectContainerWithContext("id", ctx)
27332733
if err != context.DeadlineExceeded {
27342734
t.Errorf("Expected 'DeadlineExceededError', got: %v", err)
27352735
}
@@ -2744,7 +2744,7 @@ func TestStartContainerWhenContextTimesOut(t *testing.T) {
27442744
ctx, cancel := context.WithTimeout(context.TODO(), 100*time.Millisecond)
27452745
defer cancel()
27462746

2747-
err := client.StartContainerWithContext(ctx, "id", nil)
2747+
err := client.StartContainerWithContext("id", nil, ctx)
27482748
if err != context.DeadlineExceeded {
27492749
t.Errorf("Expected 'DeadlineExceededError', got: %v", err)
27502750
}
@@ -2759,7 +2759,7 @@ func TestStopContainerWhenContextTimesOut(t *testing.T) {
27592759
ctx, cancel := context.WithTimeout(context.TODO(), 50*time.Millisecond)
27602760
defer cancel()
27612761

2762-
err := client.StopContainerWithContext(ctx, "id", 10)
2762+
err := client.StopContainerWithContext("id", 10, ctx)
27632763
if err != context.DeadlineExceeded {
27642764
t.Errorf("Expected 'DeadlineExceededError', got: %v", err)
27652765
}

0 commit comments

Comments
 (0)