@@ -12,7 +12,7 @@ import (
1212 "testing"
1313 "time"
1414
15- "github.com/docker/docker/api/types"
15+ "github.com/docker/docker/api/types/container "
1616 "github.com/docker/docker/errdefs"
1717 "gotest.tools/v3/assert"
1818 is "gotest.tools/v3/assert/cmp"
@@ -22,22 +22,22 @@ func TestContainerLogsNotFoundError(t *testing.T) {
2222 client := & Client {
2323 client : newMockClient (errorMock (http .StatusNotFound , "Not found" )),
2424 }
25- _ , err := client .ContainerLogs (context .Background (), "container_id" , types. ContainerLogsOptions {})
25+ _ , err := client .ContainerLogs (context .Background (), "container_id" , container. LogsOptions {})
2626 assert .Check (t , is .ErrorType (err , errdefs .IsNotFound ))
2727}
2828
2929func TestContainerLogsError (t * testing.T ) {
3030 client := & Client {
3131 client : newMockClient (errorMock (http .StatusInternalServerError , "Server error" )),
3232 }
33- _ , err := client .ContainerLogs (context .Background (), "container_id" , types. ContainerLogsOptions {})
33+ _ , err := client .ContainerLogs (context .Background (), "container_id" , container. LogsOptions {})
3434 assert .Check (t , is .ErrorType (err , errdefs .IsSystem ))
3535
36- _ , err = client .ContainerLogs (context .Background (), "container_id" , types. ContainerLogsOptions {
36+ _ , err = client .ContainerLogs (context .Background (), "container_id" , container. LogsOptions {
3737 Since : "2006-01-02TZ" ,
3838 })
3939 assert .Check (t , is .ErrorContains (err , `parsing time "2006-01-02TZ"` ))
40- _ , err = client .ContainerLogs (context .Background (), "container_id" , types. ContainerLogsOptions {
40+ _ , err = client .ContainerLogs (context .Background (), "container_id" , container. LogsOptions {
4141 Until : "2006-01-02TZ" ,
4242 })
4343 assert .Check (t , is .ErrorContains (err , `parsing time "2006-01-02TZ"` ))
@@ -46,7 +46,7 @@ func TestContainerLogsError(t *testing.T) {
4646func TestContainerLogs (t * testing.T ) {
4747 expectedURL := "/containers/container_id/logs"
4848 cases := []struct {
49- options types. ContainerLogsOptions
49+ options container. LogsOptions
5050 expectedQueryParams map [string ]string
5151 expectedError string
5252 }{
@@ -56,15 +56,15 @@ func TestContainerLogs(t *testing.T) {
5656 },
5757 },
5858 {
59- options : types. ContainerLogsOptions {
59+ options : container. LogsOptions {
6060 Tail : "any" ,
6161 },
6262 expectedQueryParams : map [string ]string {
6363 "tail" : "any" ,
6464 },
6565 },
6666 {
67- options : types. ContainerLogsOptions {
67+ options : container. LogsOptions {
6868 ShowStdout : true ,
6969 ShowStderr : true ,
7070 Timestamps : true ,
@@ -81,7 +81,7 @@ func TestContainerLogs(t *testing.T) {
8181 },
8282 },
8383 {
84- options : types. ContainerLogsOptions {
84+ options : container. LogsOptions {
8585 // timestamp will be passed as is
8686 Since : "1136073600.000000001" ,
8787 },
@@ -91,7 +91,7 @@ func TestContainerLogs(t *testing.T) {
9191 },
9292 },
9393 {
94- options : types. ContainerLogsOptions {
94+ options : container. LogsOptions {
9595 // timestamp will be passed as is
9696 Until : "1136073600.000000001" ,
9797 },
@@ -101,14 +101,14 @@ func TestContainerLogs(t *testing.T) {
101101 },
102102 },
103103 {
104- options : types. ContainerLogsOptions {
104+ options : container. LogsOptions {
105105 // An complete invalid date will not be passed
106106 Since : "invalid value" ,
107107 },
108108 expectedError : `invalid value for "since": failed to parse value as time or duration: "invalid value"` ,
109109 },
110110 {
111- options : types. ContainerLogsOptions {
111+ options : container. LogsOptions {
112112 // An complete invalid date will not be passed
113113 Until : "invalid value" ,
114114 },
@@ -153,7 +153,7 @@ func ExampleClient_ContainerLogs_withTimeout() {
153153 defer cancel ()
154154
155155 client , _ := NewClientWithOpts (FromEnv )
156- reader , err := client .ContainerLogs (ctx , "container_id" , types. ContainerLogsOptions {})
156+ reader , err := client .ContainerLogs (ctx , "container_id" , container. LogsOptions {})
157157 if err != nil {
158158 log .Fatal (err )
159159 }
0 commit comments