1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

added APIVersion when call NewRegistry

This commit is contained in:
Nan Monnand Deng 2013-06-28 17:33:28 -04:00
parent 1bb8f60d5a
commit 65185a565b
2 changed files with 15 additions and 3 deletions

View file

@ -66,6 +66,18 @@ type APIVersion struct {
GoVersion string `json:",omitempty"`
}
func (v *APIVersion) Name() string {
return "docker"
}
func (v *APIVersion) Version() string {
r, err := json.Marshal(v)
if err != nil {
return r.Version
}
return string(r)
}
type APIWait struct {
StatusCode int
}

View file

@ -55,7 +55,7 @@ func (srv *Server) ContainerExport(name string, out io.Writer) error {
}
func (srv *Server) ImagesSearch(term string) ([]APISearch, error) {
r, err := registry.NewRegistry(srv.runtime.root, nil)
r, err := registry.NewRegistry(srv.runtime.root, nil, srv.DockerVersion())
if err != nil {
return nil, err
}
@ -470,7 +470,7 @@ func (srv *Server) poolRemove(kind, key string) error {
}
func (srv *Server) ImagePull(localName string, tag string, out io.Writer, sf *utils.StreamFormatter, authConfig *auth.AuthConfig) error {
r, err := registry.NewRegistry(srv.runtime.root, authConfig)
r, err := registry.NewRegistry(srv.runtime.root, authConfig, srv.DockerVersion())
if err != nil {
return err
}
@ -687,7 +687,7 @@ func (srv *Server) ImagePush(localName string, out io.Writer, sf *utils.StreamFo
out = utils.NewWriteFlusher(out)
img, err := srv.runtime.graph.Get(localName)
r, err2 := registry.NewRegistry(srv.runtime.root, authConfig)
r, err2 := registry.NewRegistry(srv.runtime.root, authConfig, srv.DockerVersion())
if err2 != nil {
return err2
}