Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compat API: network inspect do not show isolate option #15907

Merged
merged 1 commit into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/api/handlers/compat/networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion test/compose/uptwice/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions test/compose/uptwice/teardown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- bash -*-

mv docker-compose.yml.bak docker-compose.yml
15 changes: 14 additions & 1 deletion test/compose/uptwice/tests.sh
Original file line number Diff line number Diff line change
@@ -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)"