Commit a425dba0 authored by jan.koester's avatar jan.koester
Browse files

test

parent 7f906b2b
Loading
Loading
Loading
Loading
+1 −0
Changes for CMakeLists.txt: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ add_executable(containerd
    src/netlink.cpp
    src/devices.cpp
    src/dhcp.cpp
    src/ipv6auto.cpp
    src/runtime.cpp
    src/containers.cpp
)
+8 −2
Changes for include/containerd/api.h: 8 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -95,7 +95,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *               = bridge); without one eth0 takes an address by SLAAC when a
 *               router on the bridge advertises a prefix
 *   gateway6    its IPv6 default route, global or link-local (fe80::1);
 *               without one router advertisements give it
 *               without one router advertisements give it -- and name
 *               servers (RDNSS): without dns they go into the container's
 *               resolv.conf, next to DHCP's
 *   dhcp6       yes: DHCPv6 when router advertisements ask for it (M flag:
 *               an address, /128, and name servers; O flag: name servers
 *               only); not with gateway6
 *   ipv6        no: eth0 without IPv6 (default yes)
 *   vlan        1-4094 (network = bridge; 0: none): the veth is an access
 *               port of that VLAN -- containerd turns on VLAN filtering of
@@ -122,7 +127,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *   ListContainers -> per container: container (name), image, state
 *       (stopped|starting|running|stopping|exited|failed), pid (host PID of
 *       its PID 1), started, exit_code, restarts, error?, network,
 *       address?, address6?, ipv6? (no if off), vlan?, veth? (the host's end of its veth pair, in the
 *       address?, address6?, ipv6? (no if off), lease6? (the address DHCPv6
 *       gave it), vlan?, veth? (the host's end of its veth pair, in the
 *       bridge), lease? (the address DHCP gave it), autostart, restart,
 *       memory (current bytes), tasks
 *   GetContainer {name} -> container (name), state & co. as in the list,
+6 −1
Changes for src/containers.cpp: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -162,6 +162,7 @@ void ended(const std::string &name, Runtime &r) {
    unlink(runFile(name, ".state").c_str());
    unlink(runFile(name, ".layers").c_str());
    unlink(runFile(name, ".lease").c_str());
    unlink(runFile(name, ".ipv6").c_str());
    bool failedStart = r.state == "starting" || ex.count("error");
    std::cerr << "containerd: " << name << " ended (" << (failedStart ? r.error : "exit " + std::to_string(r.exitCode)) << ")" << std::endl;
    setState(name, r, failedStart ? "failed" : "exited");
@@ -419,6 +420,10 @@ void addRecord(Result &out, const std::string &name, const Settings &s) {
        auto lease = keyValues(runFile(name, ".lease"));
        if (!lease["address"].empty()) out.add("lease", lease["address"]);
    }
    if (s.network == "bridge" && s.dhcp6 && active(r)) {
        auto lease6 = keyValues(runFile(name, ".ipv6"));
        if (!lease6["address"].empty()) out.add("lease6", lease6["address"]);
    }
    out.add("autostart", s.autostart);
    out.add("restart", s.restart);
    std::string mem, tasks;
@@ -503,7 +508,7 @@ Result remove(const std::string &name) {
    if (unlink(settingsPath(name).c_str()) != 0) return fail(sysErr(settingsPath(name), errno), 500);
    unlink(logPath(name).c_str());
    unlink((logPath(name) + ".1").c_str());
    for (const char *ext : {".exit", ".state", ".layers", ".lease"}) unlink(runFile(name, ext).c_str());
    for (const char *ext : {".exit", ".state", ".layers", ".lease", ".ipv6"}) unlink(runFile(name, ext).c_str());
    table().erase(name);
    return discard(name);
}

src/ipv6auto.cpp

0 → 100644
+533 −0

File added.

Preview size limit exceeded, changes collapsed.

src/ipv6auto.h

0 → 100644
+143 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading