Windows: Fixes termination-file mounting for containerd

If Containerd is used on Windows, then we can also mount individual
files into containers (e.g.: termination-log files), which was not
possible with Docker.

Checks if the container runtime is containerd, and if it is, then also
mount the termination-log file.
This commit is contained in:
Claudiu Belu
2019-09-04 09:16:21 -07:00
parent 3a50184421
commit d4d7f58362
7 changed files with 40 additions and 5 deletions

View File

@@ -63,6 +63,9 @@ type Runtime interface {
// Type returns the type of the container runtime.
Type() string
//SupportsSingleFileMapping returns whether the container runtime supports single file mappings or not.
SupportsSingleFileMapping() bool
// Version returns the version information of the container runtime.
Version() (Version, error)

View File

@@ -177,6 +177,10 @@ func (f *FakeRuntime) Type() string {
return f.RuntimeType
}
func (f *FakeRuntime) SupportsSingleFileMapping() bool {
return true
}
func (f *FakeRuntime) Version() (kubecontainer.Version, error) {
f.Lock()
defer f.Unlock()

View File

@@ -47,6 +47,11 @@ func (r *Mock) Type() string {
return args.Get(0).(string)
}
func (r *Mock) SupportsSingleFileMapping() bool {
args := r.Called()
return args.Get(0).(bool)
}
func (r *Mock) Version() (kubecontainer.Version, error) {
args := r.Called()
return args.Get(0).(kubecontainer.Version), args.Error(1)