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:
parent
1bb8f60d5a
commit
65185a565b
2 changed files with 15 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue