MCPcopy Create free account
hub / github.com/apache/mesos / removeDockerIPv6UserNetwork

Function removeDockerIPv6UserNetwork

src/tests/containerizer/docker_common.hpp:145–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143
144
145inline void removeDockerIPv6UserNetwork()
146{
147 // Docker IPv6 is not supported on Windows, so no-op on that platform.
148 // TODO(akagup): Remove the #ifdef when Windows supports IPv6 networks
149 // in docker containers. See MESOS-8566.
150#ifndef __WINDOWS__
151 // Delete the Docker user network.
152 Try<std::string> dockerCommand =
153 strings::format("docker network rm %s", DOCKER_IPv6_NETWORK);
154
155 Try<process::Subprocess> s = subprocess(
156 dockerCommand.get(),
157 process::Subprocess::PATH("/dev/null"),
158 process::Subprocess::PATH("/dev/null"),
159 process::Subprocess::PIPE());
160
161 // This is best effort cleanup. In case of an error just a log an
162 // error.
163 ASSERT_SOME(s) << "Unable to delete the Docker IPv6 network: "
164 << DOCKER_IPv6_NETWORK;
165
166 process::Future<std::string> err = process::io::read(s->err().get());
167
168 // Wait for the network to be deleted.
169 AWAIT_READY(s->status());
170 AWAIT_READY(err);
171
172 ASSERT_SOME(s->status().get());
173 ASSERT_EQ(s->status()->get(), 0)
174 << "Unable to delete the Docker IPv6 network "
175 << DOCKER_IPv6_NETWORK
176 << " : " << err.get();
177#endif // __WINDOWS__
178}
179
180
181inline void assertDockerKillStatus(process::Future<Option<int>>& status)

Callers 2

TearDownMethod · 0.85
TearDownMethod · 0.85

Calls 6

formatFunction · 0.85
errMethod · 0.80
subprocessFunction · 0.50
readFunction · 0.50
getMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected