Compare commits

...

13 Commits

Author SHA1 Message Date
Kir Kolyshkin
95edf9a737 Fix fetching LVM2 sources
Version 2.02.173 has disappeared, let's revert back to latest stable
one.

https://github.com/moby/moby/issues/34843

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit a436d8a634)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2020-03-23 10:00:02 +00:00
Andrew Hsu
f0ae576e63 bump version to 17.09.0-ce-rc2
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2020-03-23 10:00:01 +00:00
John Howard
26f1c6ce94 LCOW: Spot fix for multi-os image pulling
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit b291f5a317)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2020-03-23 10:00:01 +00:00
Victor Vieux
199fcf776d Revert "Add skip for known failure"
This reverts commit b33e8d49d4cdef9446af1d488d43e604fb88f08e.

Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2020-03-23 10:00:01 +00:00
Kir Kolyshkin
91028066d0 overlay gd: fix build for 32-bit ARM
This commit reverts a hunk of commit 2f5f0af3f ("Add unconvert linter")
and adds a hint for unconvert linter to ignore excessive conversion as
it is required on 32-bit platforms (e.g. armhf).

The exact error on armhf is this:

	19:06:45 ---> Making bundle: dynbinary (in bundles/17.06.0-dev/dynbinary)
	19:06:48 Building: bundles/17.06.0-dev/dynbinary-daemon/dockerd-17.06.0-dev
	19:10:58 # github.com/docker/docker/daemon/graphdriver/overlay
	19:10:58 daemon/graphdriver/overlay/copy.go:161: cannot use stat.Atim.Sec (type int32) as type int64 in argument to time.Unix
	19:10:58 daemon/graphdriver/overlay/copy.go:161: cannot use stat.Atim.Nsec (type int32) as type int64 in argument to time.Unix
	19:10:58 daemon/graphdriver/overlay/copy.go:162: cannot use stat.Mtim.Sec (type int32) as type int64 in argument to time.Unix
	19:10:58 daemon/graphdriver/overlay/copy.go:162: cannot use stat.Mtim.Nsec (type int32) as type int64 in argument to time.Unix

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 0120303d8ea4a1d9f8920ac4dba80521072e8536)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2020-03-23 10:00:01 +00:00
Kir Kolyshkin
11f2b52626 Fix 'make all' for other platforms
Since commit d7e2c4ce7 ("Use gometalinter for linting") command
"make all" fails on all the non-default platforms (i.e. ARMs, PPC, and
s390) in this way:

	# make all
	...
	Congratulations!  All commits are properly signed with the DCO!
	/go/src/github.com/docker/docker/hack/validate/gometalinter: line 6: gometalinter: command not found
	Makefile:105: recipe for target 'all' failed
	make: *** [all] Error 127

Make sure gometalinter is installed for those platforms

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 0c0047e67f8ee73f73465ac60ccebbd16260ab46)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2020-03-23 10:00:01 +00:00
Simon Ferquel
91b572a463 re-enable some conversion for darwin-amd64 platform
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
(cherry picked from commit 7c9e64a2e1)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2020-03-23 10:00:01 +00:00
Daniel Nephin
01f2f9f623 Fix a bad assumption
If the empty variable happens to be sorted to the end of the list then TrimSpace()
would remove it. Instead only strip the single trailing newline.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit fff605c3b3)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2020-03-23 10:00:01 +00:00
Eli Uriegas
09f92710e6 bump version to 17.09.0-ce-rc1
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2020-03-23 10:00:01 +00:00
Eli Uriegas
e0b74439fc Add skip for known failure
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2020-03-23 10:00:01 +00:00
Eli Uriegas
1a402b71c0 Changes error check form NotNil to IsNil
rmi -f always returns a 0 exit code so these tests needed to be changed
accordingly.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2020-03-23 10:00:01 +00:00
Daniel Nephin
acc3af8123 Fix integration suite and propagate failures
Failures from the integration suite were not propagating to the outter shell
for some reason. Handle the failure with an if exit 1.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 96707bc600)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2020-03-23 10:00:01 +00:00
Victor Vieux
b2a84ed455 force inspect test format
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
(cherry picked from commit 8e6567cb83)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2020-03-23 10:00:01 +00:00
18 changed files with 72 additions and 34 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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"]

View File

@@ -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

View File

@@ -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

View File

@@ -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 \

View File

@@ -1 +1 @@
17.06.0-dev
17.09.0-ce-rc2

View File

@@ -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
}

View File

@@ -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

View File

@@ -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

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
set -e -o pipefail
source "${MAKEDIR}/.go-autogen"
source hack/make/.integration-test-helpers

View File

@@ -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

View File

@@ -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))
}

View File

@@ -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{

View File

@@ -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")
}

View File

@@ -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")

View File

@@ -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())

View File

@@ -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
}
}