mirror of https://github.com/docker/docs.git
Fix issue when login in with a different user and trying to push
This commit is contained in:
parent
b38fc9fcdc
commit
f20b5e1323
|
@ -6,6 +6,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/dotcloud/docker/auth"
|
"github.com/dotcloud/docker/auth"
|
||||||
"github.com/dotcloud/docker/rcli"
|
"github.com/dotcloud/docker/rcli"
|
||||||
|
"github.com/shin-/cookiejar"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -154,6 +155,7 @@ func (srv *Server) CmdLogin(stdin io.ReadCloser, stdout rcli.DockerConn, args ..
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(stdout, "Error: %s\r\n", err)
|
fmt.Fprintf(stdout, "Error: %s\r\n", err)
|
||||||
} else {
|
} else {
|
||||||
|
srv.runtime.graph.getHttpClient().Jar = cookiejar.NewCookieJar()
|
||||||
srv.runtime.authConfig = newAuthConfig
|
srv.runtime.authConfig = newAuthConfig
|
||||||
}
|
}
|
||||||
if status != "" {
|
if status != "" {
|
||||||
|
|
|
@ -69,7 +69,7 @@ func (graph *Graph) getRemoteHistory(imgId, registry string, token []string) ([]
|
||||||
|
|
||||||
func (graph *Graph) getHttpClient() *http.Client {
|
func (graph *Graph) getHttpClient() *http.Client {
|
||||||
if graph.httpClient == nil {
|
if graph.httpClient == nil {
|
||||||
graph.httpClient = new(http.Client)
|
graph.httpClient = &http.Client{}
|
||||||
graph.httpClient.Jar = cookiejar.NewCookieJar()
|
graph.httpClient.Jar = cookiejar.NewCookieJar()
|
||||||
}
|
}
|
||||||
return graph.httpClient
|
return graph.httpClient
|
||||||
|
|
Loading…
Reference in New Issue