@@ -22,6 +22,7 @@ import (
2222
2323 "github.com/docker/docker/api/types"
2424 "github.com/docker/docker/api/types/container"
25+ "github.com/docker/docker/api/types/image"
2526 "github.com/docker/docker/client"
2627 "github.com/docker/docker/pkg/stdcopy"
2728 "github.com/docker/go-connections/nat"
@@ -100,7 +101,7 @@ func (d *Builder) removeNetworks() error {
100101
101102// removeImages removes all images with `complementLabel`.
102103func (d * Builder ) removeImages () error {
103- images , err := d .Docker .ImageList (context .Background (), types. ImageListOptions {
104+ images , err := d .Docker .ImageList (context .Background (), image. ListOptions {
104105 Filters : label (
105106 complementLabel ,
106107 "complement_pkg=" + d .Config .PackageNamespace ,
@@ -136,7 +137,7 @@ func (d *Builder) removeImages() error {
136137 d .log ("Keeping image created from blueprint %s" , bprintName )
137138 continue
138139 }
139- _ , err = d .Docker .ImageRemove (context .Background (), img .ID , types. ImageRemoveOptions {
140+ _ , err = d .Docker .ImageRemove (context .Background (), img .ID , image. RemoveOptions {
140141 Force : true ,
141142 })
142143 if err != nil {
@@ -149,7 +150,7 @@ func (d *Builder) removeImages() error {
149150
150151// removeContainers removes all containers with `complementLabel`.
151152func (d * Builder ) removeContainers () error {
152- containers , err := d .Docker .ContainerList (context .Background (), types. ContainerListOptions {
153+ containers , err := d .Docker .ContainerList (context .Background (), container. ListOptions {
153154 All : true ,
154155 Filters : label (
155156 complementLabel ,
@@ -160,7 +161,7 @@ func (d *Builder) removeContainers() error {
160161 return err
161162 }
162163 for _ , c := range containers {
163- err = d .Docker .ContainerRemove (context .Background (), c .ID , types. ContainerRemoveOptions {
164+ err = d .Docker .ContainerRemove (context .Background (), c .ID , container. RemoveOptions {
164165 Force : true ,
165166 })
166167 if err != nil {
@@ -171,7 +172,7 @@ func (d *Builder) removeContainers() error {
171172}
172173
173174func (d * Builder ) ConstructBlueprintIfNotExist (bprint b.Blueprint ) error {
174- images , err := d .Docker .ImageList (context .Background (), types. ImageListOptions {
175+ images , err := d .Docker .ImageList (context .Background (), image. ListOptions {
175176 Filters : label (
176177 "complement_blueprint=" + bprint .Name ,
177178 "complement_pkg=" + d .Config .PackageNamespace ,
@@ -200,12 +201,12 @@ func (d *Builder) ConstructBlueprint(bprint b.Blueprint) error {
200201
201202 // wait a bit for images/containers to show up in 'image ls'
202203 foundImages := false
203- var images []types. ImageSummary
204+ var images []image. Summary
204205 var err error
205206 waitTime := 5 * time .Second
206207 startTime := time .Now ()
207208 for time .Since (startTime ) < waitTime {
208- images , err = d .Docker .ImageList (context .Background (), types. ImageListOptions {
209+ images , err = d .Docker .ImageList (context .Background (), image. ListOptions {
209210 Filters : label (
210211 complementLabel ,
211212 "complement_blueprint=" + bprint .Name ,
@@ -255,7 +256,7 @@ func (d *Builder) construct(bprint b.Blueprint) (errs []error) {
255256 // something went wrong, but we have a container which may have interesting logs
256257 printLogs (d .Docker , res .containerID , res .contextStr )
257258 }
258- if delErr := d .Docker .ContainerRemove (context .Background (), res .containerID , types. ContainerRemoveOptions {
259+ if delErr := d .Docker .ContainerRemove (context .Background (), res .containerID , container. RemoveOptions {
259260 Force : true ,
260261 }); delErr != nil {
261262 d .log ("%s: failed to remove container which failed to deploy: %s" , res .contextStr , delErr )
@@ -334,7 +335,7 @@ func (d *Builder) construct(bprint b.Blueprint) (errs []error) {
334335 d .log ("%s: Stopped container: %s" , res .contextStr , res .containerID )
335336
336337 // commit the container
337- commit , err := d .Docker .ContainerCommit (context .Background (), res .containerID , types. ContainerCommitOptions {
338+ commit , err := d .Docker .ContainerCommit (context .Background (), res .containerID , container. CommitOptions {
338339 Author : "Complement" ,
339340 Pause : true ,
340341 Reference : "localhost/complement:" + res .contextStr ,
@@ -475,7 +476,7 @@ func createNetworkIfNotExists(docker *client.Client, pkgNamespace, blueprintName
475476}
476477
477478func printLogs (docker * client.Client , containerID , contextStr string ) {
478- reader , err := docker .ContainerLogs (context .Background (), containerID , types. ContainerLogsOptions {
479+ reader , err := docker .ContainerLogs (context .Background (), containerID , container. LogsOptions {
479480 ShowStderr : true ,
480481 ShowStdout : true ,
481482 Follow : false ,
0 commit comments