mirror of
https://github.com/moby/moby.git
synced 2026-01-14 12:18:09 +00:00
Compare commits
25 Commits
docker-29.
...
v17.09.0-c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91437e70a0 | ||
|
|
9192f71fd2 | ||
|
|
b53490f949 | ||
|
|
a79db26f0e | ||
|
|
557bd32c1c | ||
|
|
b1d8ff1a1b | ||
|
|
87b74b0fe8 | ||
|
|
3f32f3da21 | ||
|
|
6f1a5612ef | ||
|
|
2cd7554dc7 | ||
|
|
92b7369d85 | ||
|
|
c14666098f | ||
|
|
95edf9a737 | ||
|
|
f0ae576e63 | ||
|
|
26f1c6ce94 | ||
|
|
199fcf776d | ||
|
|
91028066d0 | ||
|
|
11f2b52626 | ||
|
|
91b572a463 | ||
|
|
01f2f9f623 | ||
|
|
09f92710e6 | ||
|
|
e0b74439fc | ||
|
|
1a402b71c0 | ||
|
|
acc3af8123 | ||
|
|
b2a84ed455 |
@@ -74,7 +74,7 @@ RUN apt-get update && apt-get install -y \
|
||||
&& pip install awscli==1.10.15
|
||||
|
||||
# Get lvm2 sources to build statically linked devmapper library
|
||||
ENV LVM2_VERSION 2.02.173
|
||||
ENV LVM2_VERSION 2.02.168
|
||||
RUN mkdir -p /usr/local/lvm2 \
|
||||
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
|
||||
| tar -xzC /usr/local/lvm2 --strip-components=1
|
||||
|
||||
@@ -55,7 +55,7 @@ RUN apt-get update && apt-get install -y \
|
||||
--no-install-recommends
|
||||
|
||||
# Get lvm2 sources to build statically linked devmapper library
|
||||
ENV LVM2_VERSION 2.02.173
|
||||
ENV LVM2_VERSION 2.02.168
|
||||
RUN mkdir -p /usr/local/lvm2 \
|
||||
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
|
||||
| tar -xzC /usr/local/lvm2 --strip-components=1
|
||||
@@ -173,7 +173,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
|
||||
# Please edit hack/dockerfile/install-binaries.sh to update them.
|
||||
COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
|
||||
COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
|
||||
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli
|
||||
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter
|
||||
ENV PATH=/usr/local/cli:$PATH
|
||||
|
||||
# Wrap all commands in the "docker-in-docker" script to allow nested containers
|
||||
|
||||
@@ -54,7 +54,7 @@ RUN apt-get update && apt-get install -y \
|
||||
&& pip install awscli==1.10.15
|
||||
|
||||
# Get lvm2 sources to build statically linked devmapper library
|
||||
ENV LVM2_VERSION 2.02.173
|
||||
ENV LVM2_VERSION 2.02.168
|
||||
RUN mkdir -p /usr/local/lvm2 \
|
||||
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
|
||||
| tar -xzC /usr/local/lvm2 --strip-components=1
|
||||
@@ -162,7 +162,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
|
||||
# Please edit hack/dockerfile/install-binaries.sh to update them.
|
||||
COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
|
||||
COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
|
||||
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli
|
||||
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter
|
||||
ENV PATH=/usr/local/cli:$PATH
|
||||
|
||||
ENTRYPOINT ["hack/dind"]
|
||||
|
||||
@@ -54,7 +54,7 @@ RUN apt-get update && apt-get install -y \
|
||||
--no-install-recommends
|
||||
|
||||
# Get lvm2 sources to build statically linked devmapper library
|
||||
ENV LVM2_VERSION 2.02.173
|
||||
ENV LVM2_VERSION 2.02.168
|
||||
RUN mkdir -p /usr/local/lvm2 \
|
||||
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
|
||||
| tar -xzC /usr/local/lvm2 --strip-components=1
|
||||
@@ -160,7 +160,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
|
||||
# Please edit hack/dockerfile/install-binaries.sh to update them.
|
||||
COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
|
||||
COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
|
||||
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli
|
||||
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter
|
||||
ENV PATH=/usr/local/cli:$PATH
|
||||
|
||||
# Wrap all commands in the "docker-in-docker" script to allow nested containers
|
||||
|
||||
@@ -65,7 +65,7 @@ RUN set -x \
|
||||
&& rm -rf "$SECCOMP_PATH"
|
||||
|
||||
# Get lvm2 sources to build statically linked devmapper library
|
||||
ENV LVM2_VERSION 2.02.173
|
||||
ENV LVM2_VERSION 2.02.168
|
||||
RUN mkdir -p /usr/local/lvm2 \
|
||||
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
|
||||
| tar -xzC /usr/local/lvm2 --strip-components=1
|
||||
@@ -153,7 +153,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
|
||||
# Please edit hack/dockerfile/install-binaries.sh to update them.
|
||||
COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
|
||||
COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
|
||||
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli
|
||||
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter
|
||||
ENV PATH=/usr/local/cli:$PATH
|
||||
|
||||
# Wrap all commands in the "docker-in-docker" script to allow nested containers
|
||||
|
||||
1
Makefile
1
Makefile
@@ -35,6 +35,7 @@ DOCKER_ENVS := \
|
||||
-e DOCKER_REMAP_ROOT \
|
||||
-e DOCKER_STORAGE_OPTS \
|
||||
-e DOCKER_USERLANDPROXY \
|
||||
-e TEST_INTEGRATION_DIR \
|
||||
-e TESTDIRS \
|
||||
-e TESTFLAGS \
|
||||
-e TIMEOUT \
|
||||
|
||||
@@ -23,7 +23,6 @@ const versionMatcher = "/v{version:[0-9.]+}"
|
||||
// Config provides the configuration for the API server
|
||||
type Config struct {
|
||||
Logging bool
|
||||
EnableCors bool
|
||||
CorsHeaders string
|
||||
Version string
|
||||
SocketGroup string
|
||||
|
||||
@@ -33,8 +33,6 @@ func installConfigFlags(conf *config.Config, flags *pflag.FlagSet) {
|
||||
flags.StringVar(&conf.BridgeConfig.FixedCIDRv6, "fixed-cidr-v6", "", "IPv6 subnet for fixed IPs")
|
||||
flags.BoolVar(&conf.BridgeConfig.EnableUserlandProxy, "userland-proxy", true, "Use userland proxy for loopback traffic")
|
||||
flags.StringVar(&conf.BridgeConfig.UserlandProxyPath, "userland-proxy-path", "", "Path to the userland proxy binary")
|
||||
flags.BoolVar(&conf.EnableCors, "api-enable-cors", false, "Enable CORS headers in the Engine API, this is deprecated by --api-cors-header")
|
||||
flags.MarkDeprecated("api-enable-cors", "Please use --api-cors-header")
|
||||
flags.StringVar(&conf.CgroupParent, "cgroup-parent", "", "Set parent cgroup for all containers")
|
||||
flags.StringVar(&conf.RemappedRoot, "userns-remap", "", "User/Group setting for user namespaces")
|
||||
flags.StringVar(&conf.ContainerdAddr, "containerd", "", "Path to containerd socket")
|
||||
|
||||
@@ -132,7 +132,6 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
|
||||
Logging: true,
|
||||
SocketGroup: cli.Config.SocketGroup,
|
||||
Version: dockerversion.Version,
|
||||
EnableCors: cli.Config.EnableCors,
|
||||
CorsHeaders: cli.Config.CorsHeaders,
|
||||
}
|
||||
|
||||
@@ -548,7 +547,7 @@ func (cli *DaemonCli) initMiddlewares(s *apiserver.Server, cfg *apiserver.Config
|
||||
vm := middleware.NewVersionMiddleware(v, api.DefaultVersion, api.MinVersion)
|
||||
s.UseMiddleware(vm)
|
||||
|
||||
if cfg.EnableCors || cfg.CorsHeaders != "" {
|
||||
if cfg.CorsHeaders != "" {
|
||||
c := middleware.NewCORSMiddleware(cfg.CorsHeaders)
|
||||
s.UseMiddleware(c)
|
||||
}
|
||||
|
||||
@@ -103,7 +103,6 @@ type CommonConfig struct {
|
||||
Root string `json:"data-root,omitempty"`
|
||||
SocketGroup string `json:"group,omitempty"`
|
||||
CorsHeaders string `json:"api-cors-header,omitempty"`
|
||||
EnableCors bool `json:"api-enable-cors,omitempty"`
|
||||
|
||||
// TrustKeyPath is used to generate the daemon ID and for signing schema 1 manifests
|
||||
// when pushing to a registry which does not support schema 2. This field is marked as
|
||||
|
||||
@@ -307,6 +307,8 @@ func (daemon *Daemon) setupConfigDir(c *container.Container) (setupErr error) {
|
||||
if err := os.Chown(fPath, rootIDs.UID+uid, rootIDs.GID+gid); err != nil {
|
||||
return errors.Wrap(err, "error setting ownership for config")
|
||||
}
|
||||
|
||||
label.Relabel(fPath, c.MountLabel, false)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -1295,7 +1295,39 @@ func rootFSToAPIType(rootfs *image.RootFS) types.RootFS {
|
||||
// setupDaemonProcess sets various settings for the daemon's process
|
||||
func setupDaemonProcess(config *config.Config) error {
|
||||
// setup the daemons oom_score_adj
|
||||
return setupOOMScoreAdj(config.OOMScoreAdjust)
|
||||
if err := setupOOMScoreAdj(config.OOMScoreAdjust); err != nil {
|
||||
return err
|
||||
}
|
||||
return setMayDetachMounts()
|
||||
}
|
||||
|
||||
// This is used to allow removal of mountpoints that may be mounted in other
|
||||
// namespaces on RHEL based kernels starting from RHEL 7.4.
|
||||
// Without this setting, removals on these RHEL based kernels may fail with
|
||||
// "device or resource busy".
|
||||
// This setting is not available in upstream kernels as it is not configurable,
|
||||
// but has been in the upstream kernels since 3.15.
|
||||
func setMayDetachMounts() error {
|
||||
f, err := os.OpenFile("/proc/sys/fs/may_detach_mounts", os.O_WRONLY, 0)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
return errors.Wrap(err, "error opening may_detach_mounts kernel config file")
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
_, err = f.WriteString("1")
|
||||
if os.IsPermission(err) {
|
||||
// Setting may_detach_mounts does not work in an
|
||||
// unprivileged container. Ignore the error, but log
|
||||
// it if we appear not to be in that situation.
|
||||
if !rsystem.RunningInUserNS() {
|
||||
logrus.Debugf("Permission denied writing %q to /proc/sys/fs/may_detach_mounts", "1")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func setupOOMScoreAdj(score int) error {
|
||||
|
||||
@@ -99,7 +99,6 @@ func (daemon *Daemon) SystemDiskUsage(ctx context.Context) (*types.DiskUsage, er
|
||||
for platform := range daemon.stores {
|
||||
layerRefs := daemon.getLayerRefs(platform)
|
||||
allLayers := daemon.stores[platform].layerStore.Map()
|
||||
var allLayersSize int64
|
||||
for _, l := range allLayers {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
|
||||
@@ -157,9 +157,10 @@ func copyDir(srcDir, dstDir string, flags copyFlags) error {
|
||||
}
|
||||
|
||||
// system.Chtimes doesn't support a NOFOLLOW flag atm
|
||||
// nolint: unconvert
|
||||
if !isSymlink {
|
||||
aTime := time.Unix(stat.Atim.Sec, stat.Atim.Nsec)
|
||||
mTime := time.Unix(stat.Mtim.Sec, stat.Mtim.Nsec)
|
||||
aTime := time.Unix(int64(stat.Atim.Sec), int64(stat.Atim.Nsec))
|
||||
mTime := time.Unix(int64(stat.Mtim.Sec), int64(stat.Mtim.Nsec))
|
||||
if err := system.Chtimes(dstPath, aTime, mTime); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -49,18 +49,19 @@ func mountFrom(dir, device, target, mType string, flags uintptr, label string) e
|
||||
output := bytes.NewBuffer(nil)
|
||||
cmd.Stdout = output
|
||||
cmd.Stderr = output
|
||||
|
||||
if err := cmd.Start(); err != nil {
|
||||
w.Close()
|
||||
return fmt.Errorf("mountfrom error on re-exec cmd: %v", err)
|
||||
}
|
||||
//write the options to the pipe for the untar exec to read
|
||||
if err := json.NewEncoder(w).Encode(options); err != nil {
|
||||
w.Close()
|
||||
return fmt.Errorf("mountfrom json encode to pipe failed: %v", err)
|
||||
}
|
||||
w.Close()
|
||||
|
||||
if err := cmd.Wait(); err != nil {
|
||||
return fmt.Errorf("mountfrom re-exec error: %v: output: %s", err, output)
|
||||
return fmt.Errorf("mountfrom re-exec error: %v: output: %v", err, output)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
"net/url"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -363,6 +364,11 @@ func (l *splunkLoggerJSON) Log(msg *logger.Message) error {
|
||||
}
|
||||
|
||||
func (l *splunkLoggerRaw) Log(msg *logger.Message) error {
|
||||
// empty or whitespace-only messages are not accepted by HEC
|
||||
if strings.TrimSpace(string(msg.Line)) == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
message := l.createSplunkMessage(msg)
|
||||
|
||||
message.Event = string(append(l.prefix, msg.Line...))
|
||||
|
||||
@@ -716,12 +716,19 @@ func TestRawFormatWithoutTag(t *testing.T) {
|
||||
if err := loggerDriver.Log(&logger.Message{Line: []byte("notjson"), Source: "stdout", Timestamp: message2Time}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
message3Time := time.Now()
|
||||
if err := loggerDriver.Log(&logger.Message{Line: []byte(" "), Source: "stdout", Timestamp: message3Time}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
err = loggerDriver.Close()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// message3 would have an empty or whitespace only string in the "event" field
|
||||
// both of which are not acceptable to HEC
|
||||
// thus here we must expect 2 messages, not 3
|
||||
if len(hec.messages) != 2 {
|
||||
t.Fatal("Expected two messages")
|
||||
}
|
||||
|
||||
@@ -206,6 +206,9 @@ func (daemon *Daemon) registerMountPoints(container *container.Container, hostCo
|
||||
}); ok {
|
||||
mp.Source = cv.CachedPath()
|
||||
}
|
||||
if mp.Driver == volume.DefaultDriverName {
|
||||
setBindModeIfNull(mp)
|
||||
}
|
||||
}
|
||||
|
||||
binds[mp.Destination] = true
|
||||
|
||||
@@ -709,11 +709,16 @@ func (p *v2Puller) pullManifestList(ctx context.Context, ref reference.Named, mf
|
||||
|
||||
logrus.Debugf("%s resolved to a manifestList object with %d entries; looking for a os/arch match", ref, len(mfstList.Manifests))
|
||||
var manifestDigest digest.Digest
|
||||
// TODO @jhowardmsft LCOW Support: Need to remove the hard coding in LCOW mode.
|
||||
lookingForOS := runtime.GOOS
|
||||
if system.LCOWSupported() {
|
||||
lookingForOS = "linux"
|
||||
}
|
||||
for _, manifestDescriptor := range mfstList.Manifests {
|
||||
// TODO(aaronl): The manifest list spec supports optional
|
||||
// "features" and "variant" fields. These are not yet used.
|
||||
// Once they are, their values should be interpreted here.
|
||||
if manifestDescriptor.Platform.Architecture == runtime.GOARCH && manifestDescriptor.Platform.OS == runtime.GOOS {
|
||||
if manifestDescriptor.Platform.Architecture == runtime.GOARCH && manifestDescriptor.Platform.OS == lookingForOS {
|
||||
manifestDigest = manifestDescriptor.Digest
|
||||
logrus.Debugf("found match for %s/%s with media type %s, digest %s", runtime.GOOS, runtime.GOARCH, manifestDescriptor.MediaType, manifestDigest.String())
|
||||
break
|
||||
|
||||
@@ -8,22 +8,32 @@
|
||||
|
||||
source "$SCRIPTDIR/make/.go-autogen"
|
||||
|
||||
# Set defaults
|
||||
: ${TEST_REPEAT:=1}
|
||||
: ${TESTFLAGS:=}
|
||||
: ${TESTDEBUG:=}
|
||||
|
||||
integration_api_dirs=("$(
|
||||
integration_api_dirs=${TEST_INTEGRATION_DIR:-"$(
|
||||
find ./integration -type d |
|
||||
grep -vE '^(./integration$|./integration/util)')")
|
||||
grep -vE '^(./integration$|./integration/util)')"}
|
||||
|
||||
run_test_integration() {
|
||||
[[ "$TESTFLAGS" != *-check.f* ]] && run_test_integration_suites
|
||||
run_test_integration_legacy_suites
|
||||
}
|
||||
|
||||
run_test_integration_suites() {
|
||||
local flags="-test.v -test.timeout=${TIMEOUT} $TESTFLAGS"
|
||||
for dir in $integration_api_dirs; do
|
||||
(
|
||||
if ! (
|
||||
cd $dir
|
||||
echo "Running $PWD"
|
||||
test_env ./test.main $flags
|
||||
)
|
||||
); then exit 1; fi
|
||||
done
|
||||
}
|
||||
|
||||
run_test_integration_legacy_suites() {
|
||||
(
|
||||
flags="-check.v -check.timeout=${TIMEOUT} -test.timeout=360m $TESTFLAGS"
|
||||
cd integration-cli
|
||||
@@ -33,7 +43,7 @@ run_test_integration() {
|
||||
}
|
||||
|
||||
build_test_suite_binaries() {
|
||||
if [ $DOCKER_INTEGRATION_TESTS_VERIFIED ]; then
|
||||
if [ ${DOCKER_INTEGRATION_TESTS_VERIFIED-} ]; then
|
||||
echo "Skipping building test binaries; as DOCKER_INTEGRATION_TESTS_VERIFIED is set"
|
||||
return
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -e -o pipefail
|
||||
|
||||
source "${MAKEDIR}/.go-autogen"
|
||||
source hack/make/.integration-test-helpers
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -30,6 +31,9 @@ import (
|
||||
"github.com/docker/docker/volume"
|
||||
"github.com/docker/go-connections/nat"
|
||||
"github.com/go-check/check"
|
||||
"github.com/gotestyourself/gotestyourself/poll"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
@@ -1910,18 +1914,38 @@ func (s *DockerSuite) TestContainersAPICreateMountsCreate(c *check.C) {
|
||||
}
|
||||
|
||||
type testCase struct {
|
||||
cfg mounttypes.Mount
|
||||
spec mounttypes.Mount
|
||||
expected types.MountPoint
|
||||
}
|
||||
|
||||
var selinuxSharedLabel string
|
||||
if runtime.GOOS == "linux" {
|
||||
selinuxSharedLabel = "z"
|
||||
}
|
||||
|
||||
cases := []testCase{
|
||||
// use literal strings here for `Type` instead of the defined constants in the volume package to keep this honest
|
||||
// Validation of the actual `Mount` struct is done in another test is not needed here
|
||||
{mounttypes.Mount{Type: "volume", Target: destPath}, types.MountPoint{Driver: volume.DefaultDriverName, Type: "volume", RW: true, Destination: destPath}},
|
||||
{mounttypes.Mount{Type: "volume", Target: destPath + slash}, types.MountPoint{Driver: volume.DefaultDriverName, Type: "volume", RW: true, Destination: destPath}},
|
||||
{mounttypes.Mount{Type: "volume", Target: destPath, Source: "test1"}, types.MountPoint{Type: "volume", Name: "test1", RW: true, Destination: destPath}},
|
||||
{mounttypes.Mount{Type: "volume", Target: destPath, ReadOnly: true, Source: "test2"}, types.MountPoint{Type: "volume", Name: "test2", RW: false, Destination: destPath}},
|
||||
{mounttypes.Mount{Type: "volume", Target: destPath, Source: "test3", VolumeOptions: &mounttypes.VolumeOptions{DriverConfig: &mounttypes.Driver{Name: volume.DefaultDriverName}}}, types.MountPoint{Driver: volume.DefaultDriverName, Type: "volume", Name: "test3", RW: true, Destination: destPath}},
|
||||
{
|
||||
spec: mounttypes.Mount{Type: "volume", Target: destPath},
|
||||
expected: types.MountPoint{Driver: volume.DefaultDriverName, Type: "volume", RW: true, Destination: destPath, Mode: selinuxSharedLabel},
|
||||
},
|
||||
{
|
||||
spec: mounttypes.Mount{Type: "volume", Target: destPath + slash},
|
||||
expected: types.MountPoint{Driver: volume.DefaultDriverName, Type: "volume", RW: true, Destination: destPath, Mode: selinuxSharedLabel},
|
||||
},
|
||||
{
|
||||
spec: mounttypes.Mount{Type: "volume", Target: destPath, Source: "test1"},
|
||||
expected: types.MountPoint{Type: "volume", Name: "test1", RW: true, Destination: destPath, Mode: selinuxSharedLabel},
|
||||
},
|
||||
{
|
||||
spec: mounttypes.Mount{Type: "volume", Target: destPath, ReadOnly: true, Source: "test2"},
|
||||
expected: types.MountPoint{Type: "volume", Name: "test2", RW: false, Destination: destPath, Mode: selinuxSharedLabel},
|
||||
},
|
||||
{
|
||||
spec: mounttypes.Mount{Type: "volume", Target: destPath, Source: "test3", VolumeOptions: &mounttypes.VolumeOptions{DriverConfig: &mounttypes.Driver{Name: volume.DefaultDriverName}}},
|
||||
expected: types.MountPoint{Driver: volume.DefaultDriverName, Type: "volume", Name: "test3", RW: true, Destination: destPath, Mode: selinuxSharedLabel},
|
||||
},
|
||||
}
|
||||
|
||||
if SameHostDaemon() {
|
||||
@@ -1930,8 +1954,23 @@ func (s *DockerSuite) TestContainersAPICreateMountsCreate(c *check.C) {
|
||||
c.Assert(err, checker.IsNil)
|
||||
defer os.RemoveAll(tmpDir1)
|
||||
cases = append(cases, []testCase{
|
||||
{mounttypes.Mount{Type: "bind", Source: tmpDir1, Target: destPath}, types.MountPoint{Type: "bind", RW: true, Destination: destPath, Source: tmpDir1}},
|
||||
{mounttypes.Mount{Type: "bind", Source: tmpDir1, Target: destPath, ReadOnly: true}, types.MountPoint{Type: "bind", RW: false, Destination: destPath, Source: tmpDir1}},
|
||||
{
|
||||
spec: mounttypes.Mount{
|
||||
Type: "bind",
|
||||
Source: tmpDir1,
|
||||
Target: destPath,
|
||||
},
|
||||
expected: types.MountPoint{
|
||||
Type: "bind",
|
||||
RW: true,
|
||||
Destination: destPath,
|
||||
Source: tmpDir1,
|
||||
},
|
||||
},
|
||||
{
|
||||
spec: mounttypes.Mount{Type: "bind", Source: tmpDir1, Target: destPath, ReadOnly: true},
|
||||
expected: types.MountPoint{Type: "bind", RW: false, Destination: destPath, Source: tmpDir1},
|
||||
},
|
||||
}...)
|
||||
|
||||
// for modes only supported on Linux
|
||||
@@ -1944,19 +1983,40 @@ func (s *DockerSuite) TestContainersAPICreateMountsCreate(c *check.C) {
|
||||
c.Assert(mount.ForceMount("", tmpDir3, "none", "shared"), checker.IsNil)
|
||||
|
||||
cases = append(cases, []testCase{
|
||||
{mounttypes.Mount{Type: "bind", Source: tmpDir3, Target: destPath}, types.MountPoint{Type: "bind", RW: true, Destination: destPath, Source: tmpDir3}},
|
||||
{mounttypes.Mount{Type: "bind", Source: tmpDir3, Target: destPath, ReadOnly: true}, types.MountPoint{Type: "bind", RW: false, Destination: destPath, Source: tmpDir3}},
|
||||
{mounttypes.Mount{Type: "bind", Source: tmpDir3, Target: destPath, ReadOnly: true, BindOptions: &mounttypes.BindOptions{Propagation: "shared"}}, types.MountPoint{Type: "bind", RW: false, Destination: destPath, Source: tmpDir3, Propagation: "shared"}},
|
||||
{
|
||||
spec: mounttypes.Mount{Type: "bind", Source: tmpDir3, Target: destPath},
|
||||
expected: types.MountPoint{Type: "bind", RW: true, Destination: destPath, Source: tmpDir3},
|
||||
},
|
||||
{
|
||||
spec: mounttypes.Mount{Type: "bind", Source: tmpDir3, Target: destPath, ReadOnly: true},
|
||||
expected: types.MountPoint{Type: "bind", RW: false, Destination: destPath, Source: tmpDir3},
|
||||
},
|
||||
{
|
||||
spec: mounttypes.Mount{Type: "bind", Source: tmpDir3, Target: destPath, ReadOnly: true, BindOptions: &mounttypes.BindOptions{Propagation: "shared"}},
|
||||
expected: types.MountPoint{Type: "bind", RW: false, Destination: destPath, Source: tmpDir3, Propagation: "shared"},
|
||||
},
|
||||
}...)
|
||||
}
|
||||
}
|
||||
|
||||
if testEnv.DaemonPlatform() != "windows" { // Windows does not support volume populate
|
||||
cases = append(cases, []testCase{
|
||||
{mounttypes.Mount{Type: "volume", Target: destPath, VolumeOptions: &mounttypes.VolumeOptions{NoCopy: true}}, types.MountPoint{Driver: volume.DefaultDriverName, Type: "volume", RW: true, Destination: destPath}},
|
||||
{mounttypes.Mount{Type: "volume", Target: destPath + slash, VolumeOptions: &mounttypes.VolumeOptions{NoCopy: true}}, types.MountPoint{Driver: volume.DefaultDriverName, Type: "volume", RW: true, Destination: destPath}},
|
||||
{mounttypes.Mount{Type: "volume", Target: destPath, Source: "test4", VolumeOptions: &mounttypes.VolumeOptions{NoCopy: true}}, types.MountPoint{Type: "volume", Name: "test4", RW: true, Destination: destPath}},
|
||||
{mounttypes.Mount{Type: "volume", Target: destPath, Source: "test5", ReadOnly: true, VolumeOptions: &mounttypes.VolumeOptions{NoCopy: true}}, types.MountPoint{Type: "volume", Name: "test5", RW: false, Destination: destPath}},
|
||||
{
|
||||
spec: mounttypes.Mount{Type: "volume", Target: destPath, VolumeOptions: &mounttypes.VolumeOptions{NoCopy: true}},
|
||||
expected: types.MountPoint{Driver: volume.DefaultDriverName, Type: "volume", RW: true, Destination: destPath, Mode: selinuxSharedLabel},
|
||||
},
|
||||
{
|
||||
spec: mounttypes.Mount{Type: "volume", Target: destPath + slash, VolumeOptions: &mounttypes.VolumeOptions{NoCopy: true}},
|
||||
expected: types.MountPoint{Driver: volume.DefaultDriverName, Type: "volume", RW: true, Destination: destPath, Mode: selinuxSharedLabel},
|
||||
},
|
||||
{
|
||||
spec: mounttypes.Mount{Type: "volume", Target: destPath, Source: "test4", VolumeOptions: &mounttypes.VolumeOptions{NoCopy: true}},
|
||||
expected: types.MountPoint{Type: "volume", Name: "test4", RW: true, Destination: destPath, Mode: selinuxSharedLabel},
|
||||
},
|
||||
{
|
||||
spec: mounttypes.Mount{Type: "volume", Target: destPath, Source: "test5", ReadOnly: true, VolumeOptions: &mounttypes.VolumeOptions{NoCopy: true}},
|
||||
expected: types.MountPoint{Type: "volume", Name: "test5", RW: false, Destination: destPath, Mode: selinuxSharedLabel},
|
||||
},
|
||||
}...)
|
||||
}
|
||||
|
||||
@@ -1968,58 +2028,83 @@ func (s *DockerSuite) TestContainersAPICreateMountsCreate(c *check.C) {
|
||||
ID string `json:"Id"`
|
||||
}
|
||||
|
||||
cli, err := client.NewEnvClient()
|
||||
c.Assert(err, checker.IsNil)
|
||||
defer cli.Close()
|
||||
|
||||
ctx := context.Background()
|
||||
apiclient := testEnv.APIClient()
|
||||
for i, x := range cases {
|
||||
c.Logf("case %d - config: %v", i, x.cfg)
|
||||
container, err := cli.ContainerCreate(context.Background(), &containertypes.Config{Image: testImg}, &containertypes.HostConfig{Mounts: []mounttypes.Mount{x.cfg}}, &networktypes.NetworkingConfig{}, "")
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Logf("case %d - config: %v", i, x.spec)
|
||||
container, err := apiclient.ContainerCreate(
|
||||
ctx,
|
||||
&containertypes.Config{Image: testImg},
|
||||
&containertypes.HostConfig{Mounts: []mounttypes.Mount{x.spec}},
|
||||
&networktypes.NetworkingConfig{},
|
||||
"")
|
||||
require.NoError(c, err)
|
||||
|
||||
id := container.ID
|
||||
containerInspect, err := apiclient.ContainerInspect(ctx, container.ID)
|
||||
require.NoError(c, err)
|
||||
mps := containerInspect.Mounts
|
||||
require.Len(c, mps, 1)
|
||||
mountPoint := mps[0]
|
||||
|
||||
var mps []types.MountPoint
|
||||
err = json.NewDecoder(strings.NewReader(inspectFieldJSON(c, id, "Mounts"))).Decode(&mps)
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(mps, checker.HasLen, 1)
|
||||
c.Assert(mps[0].Destination, checker.Equals, x.expected.Destination)
|
||||
if x.expected.Source != "" {
|
||||
assert.Equal(c, x.expected.Source, mountPoint.Source)
|
||||
}
|
||||
if x.expected.Name != "" {
|
||||
assert.Equal(c, x.expected.Name, mountPoint.Name)
|
||||
}
|
||||
if x.expected.Driver != "" {
|
||||
assert.Equal(c, x.expected.Driver, mountPoint.Driver)
|
||||
}
|
||||
if x.expected.Propagation != "" {
|
||||
assert.Equal(c, x.expected.Propagation, mountPoint.Propagation)
|
||||
}
|
||||
assert.Equal(c, x.expected.RW, mountPoint.RW)
|
||||
assert.Equal(c, x.expected.Type, mountPoint.Type)
|
||||
assert.Equal(c, x.expected.Mode, mountPoint.Mode)
|
||||
assert.Equal(c, x.expected.Destination, mountPoint.Destination)
|
||||
|
||||
if len(x.expected.Source) > 0 {
|
||||
c.Assert(mps[0].Source, checker.Equals, x.expected.Source)
|
||||
}
|
||||
if len(x.expected.Name) > 0 {
|
||||
c.Assert(mps[0].Name, checker.Equals, x.expected.Name)
|
||||
}
|
||||
if len(x.expected.Driver) > 0 {
|
||||
c.Assert(mps[0].Driver, checker.Equals, x.expected.Driver)
|
||||
}
|
||||
c.Assert(mps[0].RW, checker.Equals, x.expected.RW)
|
||||
c.Assert(mps[0].Type, checker.Equals, x.expected.Type)
|
||||
c.Assert(mps[0].Mode, checker.Equals, x.expected.Mode)
|
||||
if len(x.expected.Propagation) > 0 {
|
||||
c.Assert(mps[0].Propagation, checker.Equals, x.expected.Propagation)
|
||||
}
|
||||
err = apiclient.ContainerStart(ctx, container.ID, types.ContainerStartOptions{})
|
||||
require.NoError(c, err)
|
||||
poll.WaitOn(c, containerExit(apiclient, container.ID), poll.WithDelay(time.Second))
|
||||
|
||||
out, _, err := dockerCmdWithError("start", "-a", id)
|
||||
if (x.cfg.Type != "volume" || (x.cfg.VolumeOptions != nil && x.cfg.VolumeOptions.NoCopy)) && testEnv.DaemonPlatform() != "windows" {
|
||||
c.Assert(err, checker.NotNil, check.Commentf("%s\n%v", out, mps[0]))
|
||||
} else {
|
||||
c.Assert(err, checker.IsNil, check.Commentf("%s\n%v", out, mps[0]))
|
||||
}
|
||||
err = apiclient.ContainerRemove(ctx, container.ID, types.ContainerRemoveOptions{
|
||||
RemoveVolumes: true,
|
||||
Force: true,
|
||||
})
|
||||
require.NoError(c, err)
|
||||
|
||||
dockerCmd(c, "rm", "-fv", id)
|
||||
if x.cfg.Type == "volume" && len(x.cfg.Source) > 0 {
|
||||
// This should still exist even though we removed the container
|
||||
dockerCmd(c, "volume", "inspect", mps[0].Name)
|
||||
} else {
|
||||
// This should be removed automatically when we removed the container
|
||||
out, _, err := dockerCmdWithError("volume", "inspect", mps[0].Name)
|
||||
c.Assert(err, checker.NotNil, check.Commentf(out))
|
||||
switch {
|
||||
|
||||
// Named volumes still exist after the container is removed
|
||||
case x.spec.Type == "volume" && len(x.spec.Source) > 0:
|
||||
_, err := apiclient.VolumeInspect(ctx, mountPoint.Name)
|
||||
require.NoError(c, err)
|
||||
|
||||
// Bind mounts are never removed with the container
|
||||
case x.spec.Type == "bind":
|
||||
|
||||
// anonymous volumes are removed
|
||||
default:
|
||||
_, err := apiclient.VolumeInspect(ctx, mountPoint.Name)
|
||||
assert.True(c, client.IsErrNotFound(err))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func containerExit(apiclient client.APIClient, name string) func(poll.LogT) poll.Result {
|
||||
return func(logT poll.LogT) poll.Result {
|
||||
container, err := apiclient.ContainerInspect(context.Background(), name)
|
||||
if err != nil {
|
||||
return poll.Error(err)
|
||||
}
|
||||
switch container.State.Status {
|
||||
case "created", "running":
|
||||
return poll.Continue("container %s is %s, waiting for exit", name, container.State.Status)
|
||||
}
|
||||
return poll.Success()
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestContainersAPICreateMountsTmpfs(c *check.C) {
|
||||
testRequires(c, DaemonIsLinux)
|
||||
type testCase struct {
|
||||
|
||||
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -211,7 +212,12 @@ func (s *DockerHubPullSuite) TestPullAllTagsFromCentralRegistry(c *check.C) {
|
||||
break
|
||||
}
|
||||
}
|
||||
c.Assert(latestLine, checker.Not(checker.Equals), "", check.Commentf("no entry for busybox:latest found after pulling all tags"))
|
||||
|
||||
if runtime.GOARCH == "amd64" {
|
||||
c.Assert(latestLine, checker.Not(checker.Equals), "", check.Commentf("no entry for busybox:latest found after pulling all tags"))
|
||||
} else {
|
||||
c.Assert(latestLine, checker.Not(checker.Contains), "", check.Commentf("no matching manifest"))
|
||||
}
|
||||
splitLatest := strings.Fields(latestLine)
|
||||
splitCurrent := strings.Fields(splitOutImageCmd[1])
|
||||
|
||||
@@ -273,7 +279,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestPullNoCredentialsNotFound(c *check
|
||||
func (s *DockerSuite) TestPullLinuxImageFailsOnWindows(c *check.C) {
|
||||
testRequires(c, DaemonIsWindows, Network)
|
||||
_, _, err := dockerCmdWithError("pull", "ubuntu")
|
||||
c.Assert(err.Error(), checker.Contains, "cannot be used on this platform")
|
||||
c.Assert(err.Error(), checker.Contains, "no matching manifest")
|
||||
}
|
||||
|
||||
// Regression test for https://github.com/docker/docker/issues/28892
|
||||
|
||||
@@ -152,7 +152,7 @@ func (s *DockerSuite) TestRmiImageIDForceWithRunningContainersAndMultipleTags(c
|
||||
|
||||
out, _, err := dockerCmdWithError("rmi", "-f", imgID)
|
||||
// rmi -f should not delete image with running containers
|
||||
c.Assert(err, checker.NotNil)
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(out, checker.Contains, "(cannot be forced) - image is being used by running container")
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ func (s *DockerSuite) TestRmiContainerImageNotFound(c *check.C) {
|
||||
// Try to remove the image of the running container and see if it fails as expected.
|
||||
out, _, err := dockerCmdWithError("rmi", "-f", imageIds[0])
|
||||
// The image of the running container should not be removed.
|
||||
c.Assert(err, checker.NotNil)
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(out, checker.Contains, "image is being used by running container", check.Commentf("out: %s", out))
|
||||
}
|
||||
|
||||
|
||||
@@ -824,7 +824,7 @@ func (s *DockerSuite) TestRunEnvironment(c *check.C) {
|
||||
})
|
||||
result.Assert(c, icmd.Success)
|
||||
|
||||
actualEnv := strings.Split(strings.TrimSpace(result.Combined()), "\n")
|
||||
actualEnv := strings.Split(strings.TrimSuffix(result.Stdout(), "\n"), "\n")
|
||||
sort.Strings(actualEnv)
|
||||
|
||||
goodEnv := []string{
|
||||
|
||||
@@ -4,6 +4,7 @@ package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
@@ -16,6 +17,7 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/docker/docker/integration-cli/checker"
|
||||
"github.com/docker/docker/integration-cli/cli"
|
||||
"github.com/docker/docker/integration-cli/cli/build"
|
||||
@@ -1563,14 +1565,18 @@ func (s *DockerSuite) TestRunWithNanoCPUs(c *check.C) {
|
||||
out, _ := dockerCmd(c, "run", "--cpus", "0.5", "--name", "test", "busybox", "sh", "-c", fmt.Sprintf("cat %s && cat %s", file1, file2))
|
||||
c.Assert(strings.TrimSpace(out), checker.Equals, "50000\n100000")
|
||||
|
||||
out = inspectField(c, "test", "HostConfig.NanoCpus")
|
||||
c.Assert(out, checker.Equals, "5e+08", check.Commentf("setting the Nano CPUs failed"))
|
||||
clt, err := client.NewEnvClient()
|
||||
c.Assert(err, checker.IsNil)
|
||||
inspect, err := clt.ContainerInspect(context.Background(), "test")
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(inspect.HostConfig.NanoCPUs, checker.Equals, int64(500000000))
|
||||
|
||||
out = inspectField(c, "test", "HostConfig.CpuQuota")
|
||||
c.Assert(out, checker.Equals, "0", check.Commentf("CPU CFS quota should be 0"))
|
||||
out = inspectField(c, "test", "HostConfig.CpuPeriod")
|
||||
c.Assert(out, checker.Equals, "0", check.Commentf("CPU CFS period should be 0"))
|
||||
|
||||
out, _, err := dockerCmdWithError("run", "--cpus", "0.5", "--cpu-quota", "50000", "--cpu-period", "100000", "busybox", "sh")
|
||||
out, _, err = dockerCmdWithError("run", "--cpus", "0.5", "--cpu-quota", "50000", "--cpu-period", "100000", "busybox", "sh")
|
||||
c.Assert(err, check.NotNil)
|
||||
c.Assert(out, checker.Contains, "Conflicting options: Nano CPUs and CPU Period cannot both be set")
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
@@ -10,6 +11,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/docker/docker/integration-cli/checker"
|
||||
"github.com/docker/docker/integration-cli/request"
|
||||
"github.com/docker/docker/pkg/parsers/kernel"
|
||||
@@ -295,20 +297,26 @@ func (s *DockerSuite) TestUpdateWithNanoCPUs(c *check.C) {
|
||||
out, _ = dockerCmd(c, "exec", "top", "sh", "-c", fmt.Sprintf("cat %s && cat %s", file1, file2))
|
||||
c.Assert(strings.TrimSpace(out), checker.Equals, "50000\n100000")
|
||||
|
||||
out = inspectField(c, "top", "HostConfig.NanoCpus")
|
||||
c.Assert(out, checker.Equals, "5e+08", check.Commentf("setting the Nano CPUs failed"))
|
||||
clt, err := client.NewEnvClient()
|
||||
c.Assert(err, checker.IsNil)
|
||||
inspect, err := clt.ContainerInspect(context.Background(), "top")
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(inspect.HostConfig.NanoCPUs, checker.Equals, int64(500000000))
|
||||
|
||||
out = inspectField(c, "top", "HostConfig.CpuQuota")
|
||||
c.Assert(out, checker.Equals, "0", check.Commentf("CPU CFS quota should be 0"))
|
||||
out = inspectField(c, "top", "HostConfig.CpuPeriod")
|
||||
c.Assert(out, checker.Equals, "0", check.Commentf("CPU CFS period should be 0"))
|
||||
|
||||
out, _, err := dockerCmdWithError("update", "--cpu-quota", "80000", "top")
|
||||
out, _, err = dockerCmdWithError("update", "--cpu-quota", "80000", "top")
|
||||
c.Assert(err, checker.NotNil)
|
||||
c.Assert(out, checker.Contains, "Conflicting options: CPU Quota cannot be updated as NanoCPUs has already been set")
|
||||
|
||||
out, _ = dockerCmd(c, "update", "--cpus", "0.8", "top")
|
||||
out = inspectField(c, "top", "HostConfig.NanoCpus")
|
||||
c.Assert(out, checker.Equals, "8e+08", check.Commentf("updating the Nano CPUs failed"))
|
||||
inspect, err = clt.ContainerInspect(context.Background(), "top")
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(inspect.HostConfig.NanoCPUs, checker.Equals, int64(800000000))
|
||||
|
||||
out = inspectField(c, "top", "HostConfig.CpuQuota")
|
||||
c.Assert(out, checker.Equals, "0", check.Commentf("CPU CFS quota should be 0"))
|
||||
out = inspectField(c, "top", "HostConfig.CpuPeriod")
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
)
|
||||
|
||||
func TestInspect(t *testing.T) {
|
||||
defer setupTest(t)()
|
||||
d := newSwarm(t)
|
||||
defer d.Stop(t)
|
||||
client, err := request.NewClientForHost(d.Sock())
|
||||
|
||||
@@ -50,8 +50,8 @@ func setHeaderForSpecialDevice(hdr *tar.Header, name string, stat interface{}) (
|
||||
// Currently go does not fill in the major/minors
|
||||
if s.Mode&unix.S_IFBLK != 0 ||
|
||||
s.Mode&unix.S_IFCHR != 0 {
|
||||
hdr.Devmajor = int64(major(s.Rdev))
|
||||
hdr.Devminor = int64(minor(s.Rdev))
|
||||
hdr.Devmajor = int64(major(uint64(s.Rdev))) // nolint: unconvert
|
||||
hdr.Devminor = int64(minor(uint64(s.Rdev))) // nolint: unconvert
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# the following lines are in sorted order, FYI
|
||||
github.com/Azure/go-ansiterm 19f72df4d05d31cbe1c56bfc8045c96babff6c7e
|
||||
github.com/Microsoft/hcsshim v0.6.3
|
||||
github.com/Microsoft/hcsshim v0.6.5
|
||||
github.com/Microsoft/go-winio v0.4.5
|
||||
github.com/moby/buildkit da2b9dc7dab99e824b2b1067ad7d0523e32dd2d9 https://github.com/dmcgowan/buildkit.git
|
||||
github.com/davecgh/go-spew 346938d642f2ec3594ed81d874461961cd0faa76
|
||||
@@ -108,7 +108,7 @@ github.com/stevvooe/continuity cd7a8e21e2b6f84799f5dd4b65faf49c8d3ee02d
|
||||
github.com/tonistiigi/fsutil 0ac4c11b053b9c5c7c47558f81f96c7100ce50fb
|
||||
|
||||
# cluster
|
||||
github.com/docker/swarmkit ddb4539f883b18ea40af44ee6de63ac2adc8dc1e
|
||||
github.com/docker/swarmkit dcd1f2d56afc08827d060fdb8ad222b00b1b6000
|
||||
github.com/gogo/protobuf v0.4
|
||||
github.com/cloudflare/cfssl 7fb22c8cba7ecaf98e4082d22d65800cf45e042a
|
||||
github.com/google/certificate-transparency d90e65c3a07988180c5b1ece71791c0b6506826e
|
||||
|
||||
6
vendor/github.com/Microsoft/hcsshim/container.go
generated
vendored
6
vendor/github.com/Microsoft/hcsshim/container.go
generated
vendored
@@ -201,12 +201,18 @@ func createContainerWithJSON(id string, c *ContainerConfig, additionalJSON strin
|
||||
|
||||
if createError == nil || IsPending(createError) {
|
||||
if err := container.registerCallback(); err != nil {
|
||||
// Terminate the container if it still exists. We're okay to ignore a failure here.
|
||||
container.Terminate()
|
||||
return nil, makeContainerError(container, operation, "", err)
|
||||
}
|
||||
}
|
||||
|
||||
err = processAsyncHcsResult(createError, resultp, container.callbackNumber, hcsNotificationSystemCreateCompleted, &defaultTimeout)
|
||||
if err != nil {
|
||||
if err == ErrTimeout {
|
||||
// Terminate the container if it still exists. We're okay to ignore a failure here.
|
||||
container.Terminate()
|
||||
}
|
||||
return nil, makeContainerError(container, operation, configuration, err)
|
||||
}
|
||||
|
||||
|
||||
11
vendor/github.com/Microsoft/hcsshim/interface.go
generated
vendored
11
vendor/github.com/Microsoft/hcsshim/interface.go
generated
vendored
@@ -30,11 +30,12 @@ type Layer struct {
|
||||
}
|
||||
|
||||
type MappedDir struct {
|
||||
HostPath string
|
||||
ContainerPath string
|
||||
ReadOnly bool
|
||||
BandwidthMaximum uint64
|
||||
IOPSMaximum uint64
|
||||
HostPath string
|
||||
ContainerPath string
|
||||
ReadOnly bool
|
||||
BandwidthMaximum uint64
|
||||
IOPSMaximum uint64
|
||||
CreateInUtilityVM bool
|
||||
}
|
||||
|
||||
type MappedPipe struct {
|
||||
|
||||
5
vendor/github.com/docker/swarmkit/ca/keyreadwriter.go
generated
vendored
5
vendor/github.com/docker/swarmkit/ca/keyreadwriter.go
generated
vendored
@@ -187,10 +187,7 @@ func (k *KeyReadWriter) ViewAndRotateKEK(cb func(KEKData, PEMKeyHeaders) (KEKDat
|
||||
return err
|
||||
}
|
||||
|
||||
if err := k.writeKey(keyBlock, updatedKEK, updatedHeaderObj); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return k.writeKey(keyBlock, updatedKEK, updatedHeaderObj)
|
||||
}
|
||||
|
||||
// ViewAndUpdateHeaders updates the header manager, and updates any headers on the existing key
|
||||
|
||||
6
vendor/github.com/docker/swarmkit/manager/allocator/network.go
generated
vendored
6
vendor/github.com/docker/swarmkit/manager/allocator/network.go
generated
vendored
@@ -175,11 +175,7 @@ func (a *Allocator) doNetworkInit(ctx context.Context) (err error) {
|
||||
if err := a.allocateServices(ctx, false); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := a.allocateTasks(ctx, false); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return a.allocateTasks(ctx, false)
|
||||
}
|
||||
|
||||
func (a *Allocator) doNetworkAlloc(ctx context.Context, ev events.Event) {
|
||||
|
||||
6
vendor/github.com/docker/swarmkit/manager/controlapi/network.go
generated
vendored
6
vendor/github.com/docker/swarmkit/manager/controlapi/network.go
generated
vendored
@@ -96,11 +96,7 @@ func validateNetworkSpec(spec *api.NetworkSpec, pg plugingetter.PluginGetter) er
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validateIPAM(spec.IPAM, pg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return validateIPAM(spec.IPAM, pg)
|
||||
}
|
||||
|
||||
// CreateNetwork creates and returns a Network based on the provided NetworkSpec.
|
||||
|
||||
17
vendor/github.com/docker/swarmkit/manager/controlapi/service.go
generated
vendored
17
vendor/github.com/docker/swarmkit/manager/controlapi/service.go
generated
vendored
@@ -56,10 +56,7 @@ func validateResourceRequirements(r *api.ResourceRequirements) error {
|
||||
if err := validateResources(r.Limits); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := validateResources(r.Reservations); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return validateResources(r.Reservations)
|
||||
}
|
||||
|
||||
func validateRestartPolicy(rp *api.RestartPolicy) error {
|
||||
@@ -161,11 +158,7 @@ func validateContainerSpec(taskSpec api.TaskSpec) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validateHealthCheck(container.Healthcheck); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return validateHealthCheck(container.Healthcheck)
|
||||
}
|
||||
|
||||
// validateImage validates image name in containerSpec
|
||||
@@ -481,11 +474,7 @@ func validateServiceSpec(spec *api.ServiceSpec) error {
|
||||
if err := validateEndpointSpec(spec.Endpoint); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := validateMode(spec); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return validateMode(spec)
|
||||
}
|
||||
|
||||
// checkPortConflicts does a best effort to find if the passed in spec has port
|
||||
|
||||
5
vendor/github.com/docker/swarmkit/manager/dispatcher/dispatcher.go
generated
vendored
5
vendor/github.com/docker/swarmkit/manager/dispatcher/dispatcher.go
generated
vendored
@@ -854,10 +854,7 @@ func (d *Dispatcher) Assignments(r *api.AssignmentsRequest, stream api.Dispatche
|
||||
appliesTo = msg.ResultsIn
|
||||
msg.Type = assignmentType
|
||||
|
||||
if err := stream.Send(&msg); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return stream.Send(&msg)
|
||||
}
|
||||
|
||||
// TODO(aaronl): Also send node secrets that should be exposed to
|
||||
|
||||
4
vendor/github.com/docker/swarmkit/manager/manager.go
generated
vendored
4
vendor/github.com/docker/swarmkit/manager/manager.go
generated
vendored
@@ -54,6 +54,9 @@ import (
|
||||
const (
|
||||
// defaultTaskHistoryRetentionLimit is the number of tasks to keep.
|
||||
defaultTaskHistoryRetentionLimit = 5
|
||||
|
||||
// Default value for grpc max message size.
|
||||
grpcMaxMessageSize = 128 << 20
|
||||
)
|
||||
|
||||
// RemoteAddrs provides a listening address and an optional advertise address
|
||||
@@ -231,6 +234,7 @@ func New(config *Config) (*Manager, error) {
|
||||
grpc.Creds(config.SecurityConfig.ServerTLSCreds),
|
||||
grpc.StreamInterceptor(grpc_prometheus.StreamServerInterceptor),
|
||||
grpc.UnaryInterceptor(grpc_prometheus.UnaryServerInterceptor),
|
||||
grpc.MaxMsgSize(grpcMaxMessageSize),
|
||||
}
|
||||
|
||||
m := &Manager{
|
||||
|
||||
5
vendor/github.com/docker/swarmkit/manager/orchestrator/update/updater.go
generated
vendored
5
vendor/github.com/docker/swarmkit/manager/orchestrator/update/updater.go
generated
vendored
@@ -384,10 +384,7 @@ func (u *Updater) updateTask(ctx context.Context, slot orchestrator.Slot, update
|
||||
return errors.New("service was deleted")
|
||||
}
|
||||
|
||||
if err := store.CreateTask(tx, updated); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return store.CreateTask(tx, updated)
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
6
vendor/github.com/docker/swarmkit/manager/scheduler/scheduler.go
generated
vendored
6
vendor/github.com/docker/swarmkit/manager/scheduler/scheduler.go
generated
vendored
@@ -92,11 +92,7 @@ func (s *Scheduler) setupTasksList(tx store.ReadTx) error {
|
||||
tasksByNode[t.NodeID][t.ID] = t
|
||||
}
|
||||
|
||||
if err := s.buildNodeSet(tx, tasksByNode); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return s.buildNodeSet(tx, tasksByNode)
|
||||
}
|
||||
|
||||
// Run is the scheduler event loop.
|
||||
|
||||
10
vendor/github.com/docker/swarmkit/manager/state/raft/raft.go
generated
vendored
10
vendor/github.com/docker/swarmkit/manager/state/raft/raft.go
generated
vendored
@@ -1283,10 +1283,7 @@ func (n *Node) reportNewAddress(ctx context.Context, id uint64) error {
|
||||
return err
|
||||
}
|
||||
newAddr := net.JoinHostPort(newHost, officialPort)
|
||||
if err := n.transport.UpdatePeerAddr(id, newAddr); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return n.transport.UpdatePeerAddr(id, newAddr)
|
||||
}
|
||||
|
||||
// ProcessRaftMessage calls 'Step' which advances the
|
||||
@@ -1848,10 +1845,7 @@ func (n *Node) applyAddNode(cc raftpb.ConfChange) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err = n.registerNode(member); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return n.registerNode(member)
|
||||
}
|
||||
|
||||
// applyUpdateNode is called when we receive a ConfChange from a member in the
|
||||
|
||||
5
vendor/github.com/docker/swarmkit/manager/state/raft/storage/storage.go
generated
vendored
5
vendor/github.com/docker/swarmkit/manager/state/raft/storage/storage.go
generated
vendored
@@ -226,10 +226,7 @@ func (e *EncryptedRaftLogger) SaveSnapshot(snapshot raftpb.Snapshot) error {
|
||||
if err := snapshotter.SaveSnap(snapshot); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := e.wal.ReleaseLockTo(snapshot.Metadata.Index); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return e.wal.ReleaseLockTo(snapshot.Metadata.Index)
|
||||
}
|
||||
|
||||
// GC garbage collects snapshots and wals older than the provided index and term
|
||||
|
||||
5
vendor/github.com/docker/swarmkit/manager/state/raft/transport/transport.go
generated
vendored
5
vendor/github.com/docker/swarmkit/manager/state/raft/transport/transport.go
generated
vendored
@@ -235,10 +235,7 @@ func (t *Transport) UpdatePeerAddr(id uint64, addr string) error {
|
||||
if !ok {
|
||||
return ErrIsNotFound
|
||||
}
|
||||
if err := p.updateAddr(addr); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return p.updateAddr(addr)
|
||||
}
|
||||
|
||||
// PeerConn returns raw grpc connection to peer.
|
||||
|
||||
@@ -334,6 +334,11 @@ func (v *localVolume) Path() string {
|
||||
return v.path
|
||||
}
|
||||
|
||||
// CachedPath returns the data location
|
||||
func (v *localVolume) CachedPath() string {
|
||||
return v.path
|
||||
}
|
||||
|
||||
// Mount implements the localVolume interface, returning the data location.
|
||||
// If there are any provided mount options, the resources will be mounted at this point
|
||||
func (v *localVolume) Mount(id string) (string, error) {
|
||||
|
||||
Reference in New Issue
Block a user