Browse code

all: remove some unused funcs and variables

Signed-off-by: Alexander Morozov <lk4d4@docker.com>

Alexander Morozov authored on 2016/04/07 02:40:01
Showing 4 changed files
... ...
@@ -153,20 +153,6 @@ func (daemon *Daemon) DisconnectFromNetwork(container *container.Container, n li
153 153
 	return nil
154 154
 }
155 155
 
156
-// called from the libcontainer pre-start hook to set the network
157
-// namespace configuration linkage to the libnetwork "sandbox" entity
158
-func (daemon *Daemon) setNetworkNamespaceKey(containerID string, pid int) error {
159
-	path := fmt.Sprintf("/proc/%d/ns/net", pid)
160
-	var sandbox libnetwork.Sandbox
161
-	search := libnetwork.SandboxContainerWalker(&sandbox, containerID)
162
-	daemon.netController.WalkSandboxes(search)
163
-	if sandbox == nil {
164
-		return fmt.Errorf("error locating sandbox id %s: no sandbox found", containerID)
165
-	}
166
-
167
-	return sandbox.SetKey(path)
168
-}
169
-
170 156
 func (daemon *Daemon) getIpcContainer(container *container.Container) (*container.Container, error) {
171 157
 	containerID := container.HostConfig.IpcMode.Container()
172 158
 	c, err := daemon.GetContainer(containerID)
... ...
@@ -355,25 +341,6 @@ func getDevicesFromPath(deviceMapping containertypes.DeviceMapping) (devs []spec
355 355
 	return devs, devPermissions, fmt.Errorf("error gathering device information while adding custom device %q: %s", deviceMapping.PathOnHost, err)
356 356
 }
357 357
 
358
-func mergeDevices(defaultDevices, userDevices []*configs.Device) []*configs.Device {
359
-	if len(userDevices) == 0 {
360
-		return defaultDevices
361
-	}
362
-
363
-	paths := map[string]*configs.Device{}
364
-	for _, d := range userDevices {
365
-		paths[d.Path] = d
366
-	}
367
-
368
-	var devs []*configs.Device
369
-	for _, d := range defaultDevices {
370
-		if _, defined := paths[d.Path]; !defined {
371
-			devs = append(devs, d)
372
-		}
373
-	}
374
-	return append(devs, userDevices...)
375
-}
376
-
377 358
 func detachMounted(path string) error {
378 359
 	return syscall.Unmount(path, syscall.MNT_DETACH)
379 360
 }
... ...
@@ -30,11 +30,6 @@ func (daemon *Daemon) getSize(container *container.Container) (int64, int64) {
30 30
 	return 0, 0
31 31
 }
32 32
 
33
-// setNetworkNamespaceKey is a no-op on Windows.
34
-func (daemon *Daemon) setNetworkNamespaceKey(containerID string, pid int) error {
35
-	return nil
36
-}
37
-
38 33
 func (daemon *Daemon) setupIpcDirs(container *container.Container) error {
39 34
 	return nil
40 35
 }
... ...
@@ -7,7 +7,6 @@ import (
7 7
 	"time"
8 8
 
9 9
 	"github.com/docker/distribution"
10
-	"github.com/docker/distribution/digest"
11 10
 	"github.com/docker/docker/layer"
12 11
 	"github.com/docker/docker/pkg/progress"
13 12
 	"golang.org/x/net/context"
... ...
@@ -79,14 +78,6 @@ func uploadDescriptors(currentUploads *int32) []UploadDescriptor {
79 79
 	}
80 80
 }
81 81
 
82
-var expectedDigests = map[layer.DiffID]digest.Digest{
83
-	layer.DiffID("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf"): digest.Digest("sha256:c5095d6cf7ee42b7b064371dcc1dc3fb4af197f04d01a60009d484bd432724fc"),
84
-	layer.DiffID("sha256:1515325234325236634634608943609283523908626098235490238423902343"): digest.Digest("sha256:968cbfe2ff5269ea1729b3804767a1f57ffbc442d3bc86f47edbf7e688a4f36e"),
85
-	layer.DiffID("sha256:6929356290463485374960346430698374523437683470934634534953453453"): digest.Digest("sha256:8a5e56ab4b477a400470a7d5d4c1ca0c91235fd723ab19cc862636a06f3a735d"),
86
-	layer.DiffID("sha256:8159352387436803946235346346368745389534789534897538734598734987"): digest.Digest("sha256:5e733e5cd3688512fc240bd5c178e72671c9915947d17bb8451750d827944cb2"),
87
-	layer.DiffID("sha256:4637863963478346897346987346987346789346789364879364897364987346"): digest.Digest("sha256:ec4bb98d15e554a9f66c3ef9296cf46772c0ded3b1592bd8324d96e2f60f460c"),
88
-}
89
-
90 82
 func TestSuccessfulUpload(t *testing.T) {
91 83
 	lum := NewLayerUploadManager(maxUploadConcurrency)
92 84
 
... ...
@@ -8,7 +8,6 @@ import (
8 8
 )
9 9
 
10 10
 func sPtr(s string) *string      { return &s }
11
-func rPtr(r rune) *rune          { return &r }
12 11
 func iPtr(i int64) *int64        { return &i }
13 12
 func u32Ptr(i int64) *uint32     { u := uint32(i); return &u }
14 13
 func fmPtr(i int64) *os.FileMode { fm := os.FileMode(i); return &fm }