Skip to content

Commit

Permalink
all: remove some unused funcs and variables
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Morozov <[email protected]>
  • Loading branch information
LK4D4 committed Apr 6, 2016
1 parent c7cf245 commit 5ee8652
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 48 deletions.
33 changes: 0 additions & 33 deletions daemon/container_operations_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,6 @@ func (daemon *Daemon) DisconnectFromNetwork(container *container.Container, n li
return nil
}

// called from the libcontainer pre-start hook to set the network
// namespace configuration linkage to the libnetwork "sandbox" entity
func (daemon *Daemon) setNetworkNamespaceKey(containerID string, pid int) error {
path := fmt.Sprintf("/proc/%d/ns/net", pid)
var sandbox libnetwork.Sandbox
search := libnetwork.SandboxContainerWalker(&sandbox, containerID)
daemon.netController.WalkSandboxes(search)
if sandbox == nil {
return fmt.Errorf("error locating sandbox id %s: no sandbox found", containerID)
}

return sandbox.SetKey(path)
}

func (daemon *Daemon) getIpcContainer(container *container.Container) (*container.Container, error) {
containerID := container.HostConfig.IpcMode.Container()
c, err := daemon.GetContainer(containerID)
Expand Down Expand Up @@ -355,25 +341,6 @@ func getDevicesFromPath(deviceMapping containertypes.DeviceMapping) (devs []spec
return devs, devPermissions, fmt.Errorf("error gathering device information while adding custom device %q: %s", deviceMapping.PathOnHost, err)
}

func mergeDevices(defaultDevices, userDevices []*configs.Device) []*configs.Device {
if len(userDevices) == 0 {
return defaultDevices
}

paths := map[string]*configs.Device{}
for _, d := range userDevices {
paths[d.Path] = d
}

var devs []*configs.Device
for _, d := range defaultDevices {
if _, defined := paths[d.Path]; !defined {
devs = append(devs, d)
}
}
return append(devs, userDevices...)
}

func detachMounted(path string) error {
return syscall.Unmount(path, syscall.MNT_DETACH)
}
Expand Down
5 changes: 0 additions & 5 deletions daemon/container_operations_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func (daemon *Daemon) getSize(container *container.Container) (int64, int64) {
return 0, 0
}

// setNetworkNamespaceKey is a no-op on Windows.
func (daemon *Daemon) setNetworkNamespaceKey(containerID string, pid int) error {
return nil
}

func (daemon *Daemon) setupIpcDirs(container *container.Container) error {
return nil
}
Expand Down
9 changes: 0 additions & 9 deletions distribution/xfer/upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"time"

"github.com/docker/distribution"
"github.com/docker/distribution/digest"
"github.com/docker/docker/layer"
"github.com/docker/docker/pkg/progress"
"golang.org/x/net/context"
Expand Down Expand Up @@ -79,14 +78,6 @@ func uploadDescriptors(currentUploads *int32) []UploadDescriptor {
}
}

var expectedDigests = map[layer.DiffID]digest.Digest{
layer.DiffID("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf"): digest.Digest("sha256:c5095d6cf7ee42b7b064371dcc1dc3fb4af197f04d01a60009d484bd432724fc"),
layer.DiffID("sha256:1515325234325236634634608943609283523908626098235490238423902343"): digest.Digest("sha256:968cbfe2ff5269ea1729b3804767a1f57ffbc442d3bc86f47edbf7e688a4f36e"),
layer.DiffID("sha256:6929356290463485374960346430698374523437683470934634534953453453"): digest.Digest("sha256:8a5e56ab4b477a400470a7d5d4c1ca0c91235fd723ab19cc862636a06f3a735d"),
layer.DiffID("sha256:8159352387436803946235346346368745389534789534897538734598734987"): digest.Digest("sha256:5e733e5cd3688512fc240bd5c178e72671c9915947d17bb8451750d827944cb2"),
layer.DiffID("sha256:4637863963478346897346987346987346789346789364879364897364987346"): digest.Digest("sha256:ec4bb98d15e554a9f66c3ef9296cf46772c0ded3b1592bd8324d96e2f60f460c"),
}

func TestSuccessfulUpload(t *testing.T) {
lum := NewLayerUploadManager(maxUploadConcurrency)

Expand Down
1 change: 0 additions & 1 deletion oci/defaults_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
)

func sPtr(s string) *string { return &s }
func rPtr(r rune) *rune { return &r }
func iPtr(i int64) *int64 { return &i }
func u32Ptr(i int64) *uint32 { u := uint32(i); return &u }
func fmPtr(i int64) *os.FileMode { fm := os.FileMode(i); return &fm }
Expand Down

0 comments on commit 5ee8652

Please sign in to comment.