@@ -136,15 +136,15 @@ func NewDockerClient(opts ...Option) (Client, error) {
136136 return c , nil
137137}
138138
139- func (client * DockerClient ) Auth (config commonAuth.AuthConfig ) error {
139+ func (client * DockerClient ) Auth (ctx context. Context , config commonAuth.AuthConfig ) error {
140140 for _ , auth := range config .Auths {
141141 client .auth [auth .Registry ] = auth
142142 }
143143
144144 return nil
145145}
146146
147- func (client * DockerClient ) Pull (repo string ) (string , error ) {
147+ func (client * DockerClient ) Pull (ctx context. Context , repo string ) (string , error ) {
148148 c , err := dockercli .NewClientWithOpts (dockercli .FromEnv , dockercli .WithAPIVersionNegotiation (), dockercli .WithHost (client .host ))
149149 if err != nil {
150150 return "" , err
@@ -168,12 +168,12 @@ func (client *DockerClient) Pull(repo string) (string, error) {
168168
169169 var closer io.ReadCloser
170170 if token == "" {
171- closer , err = c .ImagePull (client . ctx , repo , dockertypes.ImagePullOptions {})
171+ closer , err = c .ImagePull (ctx , repo , dockertypes.ImagePullOptions {})
172172 if err != nil {
173173 return "" , err
174174 }
175175 } else {
176- closer , err = c .ImagePull (client . ctx , repo , dockertypes.ImagePullOptions {
176+ closer , err = c .ImagePull (ctx , repo , dockertypes.ImagePullOptions {
177177 RegistryAuth : token ,
178178 })
179179 if err != nil {
@@ -189,13 +189,13 @@ func (client *DockerClient) Pull(repo string) (string, error) {
189189 return named .String (), nil
190190}
191191
192- func (client * DockerClient ) Remove (id string ) error {
192+ func (client * DockerClient ) Remove (ctx context. Context , id string ) error {
193193 c , err := dockercli .NewClientWithOpts (dockercli .FromEnv , dockercli .WithAPIVersionNegotiation (), dockercli .WithHost (client .host ))
194194 if err != nil {
195195 return err
196196 }
197197
198- _ , err = c .ImageRemove (client . ctx , id , dockertypes.ImageRemoveOptions {
198+ _ , err = c .ImageRemove (ctx , id , dockertypes.ImageRemoveOptions {
199199 Force : true ,
200200 PruneChildren : true ,
201201 })
0 commit comments