From e99a633720563d8d8d2669791cee542c0f989291 Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 21 Jun 2017 20:26:35 -0700 Subject: [PATCH] LCOW: owner and network endpoints Signed-off-by: John Howard --- libcontainerd/client_windows.go | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/libcontainerd/client_windows.go b/libcontainerd/client_windows.go index 5349b66b5c..e9f7e696d4 100644 --- a/libcontainerd/client_windows.go +++ b/libcontainerd/client_windows.go @@ -292,10 +292,11 @@ func (clnt *client) createLinux(containerID string, checkpoint string, checkpoin // TODO @jhowardmsft LCOW Support: This needs to be configurable, not hard-coded. // However, good-enough for the LCOW bring-up. configuration := &hcsshim.ContainerConfig{ - HvPartition: true, - Name: containerID, - SystemType: "container", - ContainerType: "linux", + HvPartition: true, + Name: containerID, + SystemType: "container", + ContainerType: "linux", + Owner: defaultOwner, TerminateOnLastHandleClosed: true, HvRuntime: &hcsshim.HvRuntime{ ImagePath: `c:\program files\lcow`, @@ -328,6 +329,18 @@ func (clnt *client) createLinux(containerID string, checkpoint string, checkpoin }) } + for _, option := range options { + if n, ok := option.(*NetworkEndpointsOption); ok { + configuration.EndpointList = n.Endpoints + configuration.AllowUnqualifiedDNSQuery = n.AllowUnqualifiedDNSQuery + if n.DNSSearchList != nil { + configuration.DNSSearchList = strings.Join(n.DNSSearchList, ",") + } + configuration.NetworkSharedContainerName = n.NetworkSharedContainerID + break + } + } + hcsContainer, err := hcsshim.CreateContainer(containerID, configuration) if err != nil { return err