summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-09-22 13:22:17 -0400
committerPaul Holzinger <pholzing@redhat.com>2022-09-25 22:10:22 -0400
commit52656887e1cd3476a18765aa81a7804fceb861b4 (patch)
tree5eabc3a6e2348982971d6c35830a1371d194f9ad
parent40e8bcb8482f2a1f60b93524ceda05770d20739e (diff)
downloadpodman-52656887e1cd3476a18765aa81a7804fceb861b4.tar.gz
podman-52656887e1cd3476a18765aa81a7804fceb861b4.tar.bz2
podman-52656887e1cd3476a18765aa81a7804fceb861b4.zip
compat API: network inspect do not show isolate option
We force the isolate option on new newtworks because that is the docker behavior. However when we inspect them they should not be displayed to the caller since they have no idea about it and docker-compose throws an error because of that. Fixes #15580 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
-rw-r--r--pkg/api/handlers/compat/networks.go7
-rw-r--r--test/compose/uptwice/docker-compose.yml3
-rw-r--r--test/compose/uptwice/teardown.sh3
-rw-r--r--test/compose/uptwice/tests.sh15
4 files changed, 25 insertions, 3 deletions
diff --git a/pkg/api/handlers/compat/networks.go b/pkg/api/handlers/compat/networks.go
index 29d1398cf..078e75ed3 100644
--- a/pkg/api/handlers/compat/networks.go
+++ b/pkg/api/handlers/compat/networks.go
@@ -118,6 +118,11 @@ func convertLibpodNetworktoDockerNetwork(runtime *libpod.Runtime, network *netty
if changeDefaultName && name == runtime.Network().DefaultNetworkName() {
name = nettypes.BridgeNetworkDriver
}
+ options := network.Options
+ // bridge always has isolate set in the compat API but we should not return it to not confuse callers
+ // https://github.com/containers/podman/issues/15580
+ delete(options, nettypes.IsolateOption)
+
report := types.NetworkResource{
Name: name,
ID: network.ID,
@@ -126,7 +131,7 @@ func convertLibpodNetworktoDockerNetwork(runtime *libpod.Runtime, network *netty
Internal: network.Internal,
EnableIPv6: network.IPv6Enabled,
Labels: network.Labels,
- Options: network.Options,
+ Options: options,
IPAM: ipam,
Scope: "local",
Attachable: false,
diff --git a/test/compose/uptwice/docker-compose.yml b/test/compose/uptwice/docker-compose.yml
index e06f9e554..71cc0806c 100644
--- a/test/compose/uptwice/docker-compose.yml
+++ b/test/compose/uptwice/docker-compose.yml
@@ -2,4 +2,5 @@ version: '3'
services:
app:
build: .
- command: sleep 10002
+ command: sleep 10001
+ stop_signal: SIGKILL # faster shutdown, no reason to wait 10 seconds
diff --git a/test/compose/uptwice/teardown.sh b/test/compose/uptwice/teardown.sh
new file mode 100644
index 000000000..115c454dc
--- /dev/null
+++ b/test/compose/uptwice/teardown.sh
@@ -0,0 +1,3 @@
+# -*- bash -*-
+
+mv docker-compose.yml.bak docker-compose.yml
diff --git a/test/compose/uptwice/tests.sh b/test/compose/uptwice/tests.sh
index 291694d83..013b5a29a 100644
--- a/test/compose/uptwice/tests.sh
+++ b/test/compose/uptwice/tests.sh
@@ -1,4 +1,17 @@
# -*- bash -*-
+CR=$'\r'
+NL=$'\n'
+
+cp docker-compose.yml docker-compose.yml.bak
sed -i -e 's/10001/10002/' docker-compose.yml
-docker-compose up -d
+output=$(docker-compose up -d 2>&1)
+
+# Horrible output check here but we really want to make sure that there are
+# no unexpected warning/errors and the normal messages are send on stderr as
+# well so we cannot check for an empty stderr.
+expected="Recreating uptwice_app_1 ... ${CR}${NL}Recreating uptwice_app_1 ... done$CR"
+if [ "$TEST_FLAVOR" = "compose_v2" ]; then
+ expected="Container uptwice-app-1 Recreate${NL}Container uptwice-app-1 Recreated${NL}Container uptwice-app-1 Starting${NL}Container uptwice-app-1 Started"
+fi
+is "$output" "$expected" "no error output in compose up (#15580)"