mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Remove dead code
Signed-off-by: Antonio Murdaca <runcom@linux.com>
This commit is contained in:
parent
c3997daeb5
commit
927d13bc3c
8 changed files with 24 additions and 66 deletions
|
@ -31,9 +31,6 @@ import (
|
||||||
"github.com/docker/libnetwork/options"
|
"github.com/docker/libnetwork/options"
|
||||||
)
|
)
|
||||||
|
|
||||||
const runDir = "/var/run/docker"
|
|
||||||
const defaultVolumesPathName = "volumes"
|
|
||||||
|
|
||||||
func (daemon *Daemon) Changes(container *Container) ([]archive.Change, error) {
|
func (daemon *Daemon) Changes(container *Container) ([]archive.Change, error) {
|
||||||
initID := fmt.Sprintf("%s-init", container.ID)
|
initID := fmt.Sprintf("%s-init", container.ID)
|
||||||
return daemon.driver.Changes(container.ID, initID)
|
return daemon.driver.Changes(container.ID, initID)
|
||||||
|
|
|
@ -12,8 +12,6 @@ import (
|
||||||
"github.com/docker/libnetwork"
|
"github.com/docker/libnetwork"
|
||||||
)
|
)
|
||||||
|
|
||||||
var runDir = os.Getenv("TEMP")
|
|
||||||
|
|
||||||
func (daemon *Daemon) Changes(container *Container) ([]archive.Change, error) {
|
func (daemon *Daemon) Changes(container *Container) ([]archive.Change, error) {
|
||||||
return daemon.driver.Changes(container.ID, container.ImageID)
|
return daemon.driver.Changes(container.ID, container.ImageID)
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,6 @@ import (
|
||||||
"log" // see gh#8745, client needs to use go log pkg
|
"log" // see gh#8745, client needs to use go log pkg
|
||||||
)
|
)
|
||||||
|
|
||||||
const CanDaemon = false
|
|
||||||
|
|
||||||
func mainDaemon() {
|
func mainDaemon() {
|
||||||
log.Fatal("This is a client-only binary - running the Docker daemon is not supported.")
|
log.Fatal("This is a client-only binary - running the Docker daemon is not supported.")
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,6 @@ import (
|
||||||
"github.com/docker/docker/utils"
|
"github.com/docker/docker/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const CanDaemon = true
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
daemonCfg = &daemon.Config{}
|
daemonCfg = &daemon.Config{}
|
||||||
registryCfg = ®istry.Options{}
|
registryCfg = ®istry.Options{}
|
||||||
|
|
|
@ -270,20 +270,6 @@ func bufferToFile(f *os.File, src io.Reader) (int64, digest.Digest, error) {
|
||||||
return n, digest.NewDigest("sha256", h), nil
|
return n, digest.NewDigest("sha256", h), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if given error is "not empty".
|
|
||||||
// Note: this is the way golang does it internally with os.IsNotExists.
|
|
||||||
func isNotEmpty(err error) bool {
|
|
||||||
switch pe := err.(type) {
|
|
||||||
case nil:
|
|
||||||
return false
|
|
||||||
case *os.PathError:
|
|
||||||
err = pe.Err
|
|
||||||
case *os.LinkError:
|
|
||||||
err = pe.Err
|
|
||||||
}
|
|
||||||
return strings.Contains(err.Error(), " not empty")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete atomically removes an image from the graph.
|
// Delete atomically removes an image from the graph.
|
||||||
func (graph *Graph) Delete(name string) error {
|
func (graph *Graph) Delete(name string) error {
|
||||||
id, err := graph.idIndex.Get(name)
|
id, err := graph.idIndex.Get(name)
|
||||||
|
|
|
@ -8,7 +8,6 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httputil"
|
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -200,29 +199,6 @@ func DockerHeaders(metaHeaders http.Header) []transport.RequestModifier {
|
||||||
return modifiers
|
return modifiers
|
||||||
}
|
}
|
||||||
|
|
||||||
type debugTransport struct {
|
|
||||||
http.RoundTripper
|
|
||||||
log func(...interface{})
|
|
||||||
}
|
|
||||||
|
|
||||||
func (tr debugTransport) RoundTrip(req *http.Request) (*http.Response, error) {
|
|
||||||
dump, err := httputil.DumpRequestOut(req, false)
|
|
||||||
if err != nil {
|
|
||||||
tr.log("could not dump request")
|
|
||||||
}
|
|
||||||
tr.log(string(dump))
|
|
||||||
resp, err := tr.RoundTripper.RoundTrip(req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
dump, err = httputil.DumpResponse(resp, false)
|
|
||||||
if err != nil {
|
|
||||||
tr.log("could not dump response")
|
|
||||||
}
|
|
||||||
tr.log(string(dump))
|
|
||||||
return resp, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func HTTPClient(transport http.RoundTripper) *http.Client {
|
func HTTPClient(transport http.RoundTripper) *http.Client {
|
||||||
if transport == nil {
|
if transport == nil {
|
||||||
transport = NewTransport(ConnectTimeout, true)
|
transport = NewTransport(ConnectTimeout, true)
|
||||||
|
|
|
@ -3,6 +3,7 @@ package registry
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/http/httputil"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -911,3 +912,26 @@ func TestIsSecureIndex(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type debugTransport struct {
|
||||||
|
http.RoundTripper
|
||||||
|
log func(...interface{})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (tr debugTransport) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||||
|
dump, err := httputil.DumpRequestOut(req, false)
|
||||||
|
if err != nil {
|
||||||
|
tr.log("could not dump request")
|
||||||
|
}
|
||||||
|
tr.log(string(dump))
|
||||||
|
resp, err := tr.RoundTripper.RoundTrip(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
dump, err = httputil.DumpResponse(resp, false)
|
||||||
|
if err != nil {
|
||||||
|
tr.log("could not dump response")
|
||||||
|
}
|
||||||
|
tr.log(string(dump))
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|
|
@ -451,25 +451,6 @@ func ParseRestartPolicy(policy string) (RestartPolicy, error) {
|
||||||
return p, nil
|
return p, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// options will come in the format of name.key=value or name.option
|
|
||||||
func parseDriverOpts(opts opts.ListOpts) (map[string][]string, error) {
|
|
||||||
out := make(map[string][]string, len(opts.GetAll()))
|
|
||||||
for _, o := range opts.GetAll() {
|
|
||||||
parts := strings.SplitN(o, ".", 2)
|
|
||||||
if len(parts) < 2 {
|
|
||||||
return nil, fmt.Errorf("invalid opt format %s", o)
|
|
||||||
} else if strings.TrimSpace(parts[0]) == "" {
|
|
||||||
return nil, fmt.Errorf("key cannot be empty %s", o)
|
|
||||||
}
|
|
||||||
values, exists := out[parts[0]]
|
|
||||||
if !exists {
|
|
||||||
values = []string{}
|
|
||||||
}
|
|
||||||
out[parts[0]] = append(values, parts[1])
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func parseKeyValueOpts(opts opts.ListOpts) ([]KeyValuePair, error) {
|
func parseKeyValueOpts(opts opts.ListOpts) ([]KeyValuePair, error) {
|
||||||
out := make([]KeyValuePair, opts.Len())
|
out := make([]KeyValuePair, opts.Len())
|
||||||
for i, o := range opts.GetAll() {
|
for i, o := range opts.GetAll() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue