mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-06 13:41:36 +00:00
Windows: Factoring out unused fields
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
@@ -1205,12 +1205,8 @@ func (s *Server) getContainersByName(version version.Version, w http.ResponseWri
|
||||
return fmt.Errorf("Missing parameter")
|
||||
}
|
||||
|
||||
if version.LessThan("1.20") {
|
||||
containerJSONRaw, err := s.daemon.ContainerInspectPre120(vars["name"])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return writeJSON(w, http.StatusOK, containerJSONRaw)
|
||||
if version.LessThan("1.20") && runtime.GOOS != "windows" {
|
||||
return getContainersByNameDownlevel(w, s, vars["name"])
|
||||
}
|
||||
|
||||
containerJSON, err := s.daemon.ContainerInspect(vars["name"])
|
||||
|
||||
@@ -121,3 +121,13 @@ func adjustCpuShares(version version.Version, hostConfig *runconfig.HostConfig)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// getContainersByNameDownlevel performs processing for pre 1.20 APIs. This
|
||||
// is only relevant on non-Windows daemons.
|
||||
func getContainersByNameDownlevel(w http.ResponseWriter, s *Server, namevar string) error {
|
||||
containerJSONRaw, err := s.daemon.ContainerInspectPre120(namevar)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return writeJSON(w, http.StatusOK, containerJSONRaw)
|
||||
}
|
||||
|
||||
@@ -60,3 +60,9 @@ func allocateDaemonPort(addr string) error {
|
||||
|
||||
func adjustCpuShares(version version.Version, hostConfig *runconfig.HostConfig) {
|
||||
}
|
||||
|
||||
// getContainersByNameDownlevel performs processing for pre 1.20 APIs. This
|
||||
// is only relevant on non-Windows daemons.
|
||||
func getContainersByNameDownlevel(w http.ResponseWriter, s *Server, namevar string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
+2
-1
@@ -250,7 +250,8 @@ type ContainerJSON struct {
|
||||
Config *runconfig.Config
|
||||
}
|
||||
|
||||
// backcompatibility struct along with ContainerConfig
|
||||
// backcompatibility struct along with ContainerConfig. Note this is not
|
||||
// used by the Windows daemon.
|
||||
type ContainerJSONPre120 struct {
|
||||
*ContainerJSONBase
|
||||
Volumes map[string]string
|
||||
|
||||
Reference in New Issue
Block a user