@@ -13,10 +13,10 @@ import (
13
13
14
14
"emperror.dev/errors"
15
15
"github.com/apex/log"
16
- "github.com/docker/docker/api/types"
17
16
"github.com/docker/docker/api/types/container"
18
17
"github.com/docker/docker/api/types/mount"
19
18
"github.com/docker/docker/client"
19
+ dockerImages "github.com/docker/docker/api/types/image" // Alias the correct images package
20
20
21
21
"github.com/pelican-dev/wings/config"
22
22
"github.com/pelican-dev/wings/environment"
@@ -161,7 +161,7 @@ func (s *Server) SetRestoring(state bool) {
161
161
162
162
// RemoveContainer removes the installation container for the server.
163
163
func (ip * InstallationProcess ) RemoveContainer () error {
164
- err := ip .client .ContainerRemove (ip .Server .Context (), ip .Server .ID ()+ "_installer" , types. ContainerRemoveOptions {
164
+ err := ip .client .ContainerRemove (ip .Server .Context (), ip .Server .ID ()+ "_installer" , container. RemoveOptions {
165
165
RemoveVolumes : true ,
166
166
Force : true ,
167
167
})
@@ -247,7 +247,7 @@ func (ip *InstallationProcess) pullInstallationImage() error {
247
247
}
248
248
249
249
// Get the ImagePullOptions.
250
- imagePullOptions := types. ImagePullOptions {All : false }
250
+ imagePullOptions := dockerImages. PullOptions {All : false }
251
251
if registryAuth != nil {
252
252
b64 , err := registryAuth .Base64 ()
253
253
if err != nil {
@@ -260,7 +260,7 @@ func (ip *InstallationProcess) pullInstallationImage() error {
260
260
261
261
r , err := ip .client .ImagePull (ip .Server .Context (), ip .Script .ContainerImage , imagePullOptions )
262
262
if err != nil {
263
- images , ierr := ip .client .ImageList (ip .Server .Context (), types. ImageListOptions {})
263
+ images , ierr := ip .client .ImageList (ip .Server .Context (), dockerImages. ListOptions {})
264
264
if ierr != nil {
265
265
// Well damn, something has gone really wrong here, just go ahead and abort there
266
266
// isn't much anything we can do to try and self-recover from this.
@@ -332,7 +332,7 @@ func (ip *InstallationProcess) AfterExecute(containerId string) error {
332
332
defer ip .RemoveContainer ()
333
333
334
334
ip .Server .Log ().WithField ("container_id" , containerId ).Debug ("pulling installation logs for server" )
335
- reader , err := ip .client .ContainerLogs (ip .Server .Context (), containerId , types. ContainerLogsOptions {
335
+ reader , err := ip .client .ContainerLogs (ip .Server .Context (), containerId , container. LogsOptions {
336
336
ShowStdout : true ,
337
337
ShowStderr : true ,
338
338
Follow : false ,
@@ -463,7 +463,7 @@ func (ip *InstallationProcess) Execute() (string, error) {
463
463
}
464
464
465
465
ip .Server .Log ().WithField ("container_id" , r .ID ).Info ("running installation script for server in container" )
466
- if err := ip .client .ContainerStart (ctx , r .ID , types. ContainerStartOptions {}); err != nil {
466
+ if err := ip .client .ContainerStart (ctx , r .ID , container. StartOptions {}); err != nil {
467
467
return "" , err
468
468
}
469
469
@@ -498,7 +498,7 @@ func (ip *InstallationProcess) Execute() (string, error) {
498
498
// the server configuration directory, as well as to a websocket listener so
499
499
// that the process can be viewed in the panel by administrators.
500
500
func (ip * InstallationProcess ) StreamOutput (ctx context.Context , id string ) error {
501
- opts := types. ContainerLogsOptions {ShowStdout : true , ShowStderr : true , Follow : true }
501
+ opts := container. LogsOptions {ShowStdout : true , ShowStderr : true , Follow : true }
502
502
reader , err := ip .client .ContainerLogs (ctx , id , opts )
503
503
if err != nil {
504
504
return err
0 commit comments