Merge pull request #4410 from TBBle/minor_windows_fixes

Minor fixes around Windows network setup
This commit is contained in:
Maksym Pavlenko 2020-07-21 15:26:18 -07:00 committed by GitHub
commit 97c081c84b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import (
"github.com/containerd/containerd/cmd/ctr/commands"
"github.com/containerd/containerd/oci"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
)
@ -107,6 +108,9 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli
}
opts = append(opts, oci.WithTTYSize(int(size.Width), int(size.Height)))
}
if context.Bool("net-host") {
return nil, errors.New("Cannot use host mode networking with Windows containers")
}
if context.Bool("isolated") {
opts = append(opts, oci.WithWindowsHyperV)
}

View File

@ -52,7 +52,7 @@ func WithWindowsIgnoreFlushesDuringBoot() SpecOpts {
}
}
// WithWindowNetworksAllowUnqualifiedDNSQuery sets `Windows.IgnoreFlushesDuringBoot`.
// WithWindowNetworksAllowUnqualifiedDNSQuery sets `Windows.Network.AllowUnqualifiedDNSQuery`.
func WithWindowNetworksAllowUnqualifiedDNSQuery() SpecOpts {
return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error {
if s.Windows == nil {