diff options
-rw-r--r-- | .cirrus.yml | 8 | ||||
-rw-r--r-- | .copr/prepare.sh | 2 | ||||
-rw-r--r-- | Dockerfile | 2 | ||||
-rw-r--r-- | Dockerfile.centos | 2 | ||||
-rw-r--r-- | Dockerfile.fedora | 2 | ||||
-rw-r--r-- | contrib/spec/podman.spec.in | 2 | ||||
-rw-r--r-- | libpod/container_internal_linux.go | 4 | ||||
-rw-r--r-- | test/e2e/run_networking_test.go | 6 |
8 files changed, 19 insertions, 9 deletions
diff --git a/.cirrus.yml b/.cirrus.yml index 093c52e29..a56697855 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -29,9 +29,9 @@ env: #### #### Cache-image names to test with ### - FEDORA_CACHE_IMAGE_NAME: "fedora-30-libpod-5156500369047552" - PRIOR_FEDORA_CACHE_IMAGE_NAME: "fedora-29-libpod-5156500369047552" - UBUNTU_CACHE_IMAGE_NAME: "ubuntu-18-libpod-5156500369047552" + FEDORA_CACHE_IMAGE_NAME: "fedora-30-libpod-5699414987898880" + PRIOR_FEDORA_CACHE_IMAGE_NAME: "fedora-29-libpod-5699414987898880" + UBUNTU_CACHE_IMAGE_NAME: "ubuntu-18-libpod-5699414987898880" #### #### Variables for composing new cache-images (used in PR testing) from @@ -41,7 +41,7 @@ env: # Git commits to use while building dependencies into cache-images FEDORA_CNI_COMMIT: "412b6d31280682bb4fab4446f113c22ff1886554" CNI_COMMIT: "7480240de9749f9a0a5c8614b17f1f03e0c06ab9" - CONMON_COMMIT: "8455ce1ef385120deb827d0f0588c04357bad4c4" + CONMON_COMMIT: "3e47d8dd45cdd973dbe256292d5e9c0bff195e56" CRIU_COMMIT: "c74b83cd49c00589c0c0468ba5fe685b67fdbd0a" # Special image w/ nested-libvirt + tools for creating new cache and base images IMAGE_BUILDER_CACHE_IMAGE_NAME: "image-builder-image-1541772081" diff --git a/.copr/prepare.sh b/.copr/prepare.sh index d7c5083ca..02444efa2 100644 --- a/.copr/prepare.sh +++ b/.copr/prepare.sh @@ -29,4 +29,4 @@ fi mkdir build/ git archive --prefix "libpod-${COMMIT_SHORT}/" --format "tar.gz" HEAD -o "build/libpod-${COMMIT_SHORT}.tar.gz" git clone https://github.com/containers/conmon -cd conmon && git checkout 8455ce1ef385120deb827d0f0588c04357bad4c4 && git archive --prefix "conmon/" --format "tar.gz" HEAD -o "../build/conmon.tar.gz" +cd conmon && git checkout 3e47d8dd45cdd973dbe256292d5e9c0bff195e56 && git archive --prefix "conmon/" --format "tar.gz" HEAD -o "../build/conmon.tar.gz" diff --git a/Dockerfile b/Dockerfile index 214fbeb34..cc3ee00e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,7 +56,7 @@ RUN set -x \ && rm -rf "$GOPATH" # Install conmon -ENV CONMON_COMMIT 8455ce1ef385120deb827d0f0588c04357bad4c4 +ENV CONMON_COMMIT 3e47d8dd45cdd973dbe256292d5e9c0bff195e56 RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone https://github.com/containers/conmon.git "$GOPATH/src/github.com/containers/conmon.git" \ diff --git a/Dockerfile.centos b/Dockerfile.centos index 72b926bff..65dbefb38 100644 --- a/Dockerfile.centos +++ b/Dockerfile.centos @@ -50,7 +50,7 @@ RUN set -x \ && go get github.com/onsi/gomega/... # Install conmon -ENV CONMON_COMMIT 8455ce1ef385120deb827d0f0588c04357bad4c4 +ENV CONMON_COMMIT 3e47d8dd45cdd973dbe256292d5e9c0bff195e56 RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone https://github.com/containers/conmon.git "$GOPATH/src/github.com/containers/conmon.git" \ diff --git a/Dockerfile.fedora b/Dockerfile.fedora index 5cbc6e1fe..dafd3b6ad 100644 --- a/Dockerfile.fedora +++ b/Dockerfile.fedora @@ -53,7 +53,7 @@ RUN set -x \ && go get github.com/onsi/gomega/... # Install conmon -ENV CONMON_COMMIT 8455ce1ef385120deb827d0f0588c04357bad4c4 +ENV CONMON_COMMIT 3e47d8dd45cdd973dbe256292d5e9c0bff195e56 RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone https://github.com/containers/conmon.git "$GOPATH/src/github.com/containers/conmon.git" \ diff --git a/contrib/spec/podman.spec.in b/contrib/spec/podman.spec.in index 68d02325a..5142de5d3 100644 --- a/contrib/spec/podman.spec.in +++ b/contrib/spec/podman.spec.in @@ -35,7 +35,7 @@ # People want conmon packaged with the copr rpm %global import_path_conmon github.com/containers/conmon %global git_conmon https://%{import_path_conmon} -%global commit_conmon 8455ce1ef385120deb827d0f0588c04357bad4c4 +%global commit_conmon 3e47d8dd45cdd973dbe256292d5e9c0bff195e56 %global shortcommit_conmon %(c=%{commit_conmon}; echo ${c:0:7}) Name: podman diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index 60633e58c..50a2e2d44 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -1069,6 +1069,10 @@ func (c *Container) getHosts() string { hosts += fmt.Sprintf("%s %s\n", fields[1], fields[0]) } } + if c.config.NetMode.IsSlirp4netns() { + // When using slirp4netns, the interface gets a static IP + hosts += fmt.Sprintf("# used by slirp4netns\n%s\t%s\n", "10.0.2.100", c.Hostname()) + } if len(c.state.NetworkStatus) > 0 && len(c.state.NetworkStatus[0].IPs) > 0 { ipAddress := strings.Split(c.state.NetworkStatus[0].IPs[0].Address.String(), "/")[0] hosts += fmt.Sprintf("%s\t%s\n", ipAddress, c.Hostname()) diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go index 1497a651b..31291d373 100644 --- a/test/e2e/run_networking_test.go +++ b/test/e2e/run_networking_test.go @@ -178,6 +178,12 @@ var _ = Describe("Podman run networking", func() { Expect(exec4.OutputToString()).To(ContainSubstring("192.0.2.2 test1")) }) + It("podman run /etc/hosts contains --hostname", func() { + session := podmanTest.Podman([]string{"run", "--rm", "--hostname", "foohostname", ALPINE, "grep", "foohostname", "/etc/hosts"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + }) + It("podman run network in user created network namespace", func() { SkipIfRootless() if Containerized() { |