diff --git a/docs/session.go b/docs/session.go index 154c63e11..75947e70a 100644 --- a/docs/session.go +++ b/docs/session.go @@ -23,6 +23,7 @@ import ( "github.com/docker/docker/cliconfig" "github.com/docker/docker/pkg/httputils" "github.com/docker/docker/pkg/ioutils" + "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/pkg/tarsum" ) @@ -35,6 +36,7 @@ type Session struct { client *http.Client // TODO(tiborvass): remove authConfig authConfig *cliconfig.AuthConfig + id string } type authTransport struct { @@ -158,6 +160,7 @@ func NewSession(client *http.Client, authConfig *cliconfig.AuthConfig, endpoint authConfig: authConfig, client: client, indexEndpoint: endpoint, + id: stringid.GenerateRandomID(), } var alwaysSetBasicAuth bool @@ -188,6 +191,11 @@ func NewSession(client *http.Client, authConfig *cliconfig.AuthConfig, endpoint return r, nil } +// ID returns this registry session's ID. +func (r *Session) ID() string { + return r.id +} + // Retrieve the history of a given image from the Registry. // Return a list of the parent's json (requested image included) func (r *Session) GetRemoteHistory(imgID, registry string) ([]string, error) {