@@ -997,14 +997,14 @@ func isBrokenPipe(e error) bool {
997997
998998// PullImage initiates a pull operation. image is the repository name to pull, and
999999// tag may be either empty, or indicate a specific tag to pull.
1000- func (daemon * Daemon ) PullImage (ref reference.Named , metaHeaders map [string ][]string , authConfig * types.AuthConfig , outStream io.Writer ) error {
1000+ func (daemon * Daemon ) PullImage (ctx context. Context , ref reference.Named , metaHeaders map [string ][]string , authConfig * types.AuthConfig , outStream io.Writer ) error {
10011001 // Include a buffer so that slow client connections don't affect
10021002 // transfer performance.
10031003 progressChan := make (chan progress.Progress , 100 )
10041004
10051005 writesDone := make (chan struct {})
10061006
1007- ctx , cancelFunc := context .WithCancel (context . Background () )
1007+ ctx , cancelFunc := context .WithCancel (ctx )
10081008
10091009 go func () {
10101010 writeDistributionProgress (cancelFunc , outStream , progressChan )
@@ -1052,7 +1052,7 @@ func (daemon *Daemon) PullOnBuild(name string, authConfigs map[string]types.Auth
10521052 pullRegistryAuth = & resolvedConfig
10531053 }
10541054
1055- if err := daemon .PullImage (ref , nil , pullRegistryAuth , output ); err != nil {
1055+ if err := daemon .PullImage (context . Background (), ref , nil , pullRegistryAuth , output ); err != nil {
10561056 return nil , err
10571057 }
10581058 return daemon .GetImage (name )
@@ -1503,15 +1503,15 @@ func configureVolumes(config *Config, rootUID, rootGID int) (*store.VolumeStore,
15031503
15041504// AuthenticateToRegistry checks the validity of credentials in authConfig
15051505func (daemon * Daemon ) AuthenticateToRegistry (authConfig * types.AuthConfig ) (string , string , error ) {
1506- return daemon .RegistryService .Auth (authConfig , dockerversion .DockerUserAgent ())
1506+ return daemon .RegistryService .Auth (authConfig , dockerversion .DockerUserAgent ("" ))
15071507}
15081508
15091509// SearchRegistryForImages queries the registry for images matching
15101510// term. authConfig is used to login.
15111511func (daemon * Daemon ) SearchRegistryForImages (term string ,
15121512 authConfig * types.AuthConfig ,
15131513 headers map [string ][]string ) (* registrytypes.SearchResults , error ) {
1514- return daemon .RegistryService .Search (term , authConfig , dockerversion .DockerUserAgent (), headers )
1514+ return daemon .RegistryService .Search (term , authConfig , dockerversion .DockerUserAgent ("" ), headers )
15151515}
15161516
15171517// IsShuttingDown tells whether the daemon is shutting down or not
0 commit comments