Skip to content

Commit 4fca826

Browse files
author
Ian Campbell
committed
bridge: Drop set -x and add metadata-activated debug knob.
The `set -x` merely adds a `: cat` to the logs, which is useless so drop it. Instead replace with a metadata key which causes the full config to be printed to the console. Using `grep .` means each line is prefixed with the filename and also handles the case where the file lacks a final newline which e.g. a simple `cat` would not. Signed-off-by: Ian Campbell <ijc@docker.com>
1 parent ac00d84 commit 4fca826

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

yml/bridge.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ onboot:
55
- "/bin/sh"
66
- "-c"
77
- |
8-
set -ex
8+
set -e
99
subnet='"10.1.0.0/16"'
1010
gateway='"10.1.0.1"'
1111
ns='"10.1.0.1"'
@@ -45,7 +45,11 @@ onboot:
4545
"type": "loopback"
4646
}
4747
EOF
48+
if [ -r "/run/config/cni.bridge/debug-show-configs" ] ; then
49+
grep . /var/lib/cni/conf/*.conf /var/lib/cni/conf/*.conflist
50+
fi
4851
runtime:
4952
mkdir: ["/var/lib/cni/conf"]
5053
binds:
5154
- /var/lib:/var/lib
55+
- /run/config:/run/config

0 commit comments

Comments
 (0)