Test quoted field in --network

Signed-off-by: Rob Murray <rob.murray@docker.com>
This commit is contained in:
Rob Murray 2024-05-08 14:16:40 +00:00
parent 4758ed0b0d
commit 068f118f88
1 changed files with 14 additions and 0 deletions

View File

@ -98,6 +98,20 @@ func TestNetworkOptAdvancedSyntax(t *testing.T) {
}, },
}, },
}, },
{
value: "name=docknet1,\"driver-opt=com.docker.network.endpoint.sysctls=net.ipv6.conf.IFNAME.accept_ra=2,net.ipv6.conf.IFNAME.forwarding=1\"",
expected: []NetworkAttachmentOpts{
{
Target: "docknet1",
Aliases: []string{},
DriverOpts: map[string]string{
// The CLI converts IFNAME to ifname - it probably shouldn't, but the API
// allows ifname to cater for this.
"com.docker.network.endpoint.sysctls": "net.ipv6.conf.ifname.accept_ra=2,net.ipv6.conf.ifname.forwarding=1",
},
},
},
},
} }
for _, tc := range testCases { for _, tc := range testCases {
tc := tc tc := tc