Skip to content
Permalink
Browse files

Force LCOW memory limit

  • Loading branch information...
brianweet committed Mar 19, 2019
1 parent 07bb45e commit cf55f29f9d494dd05450f75f80ed43190c3df110
Showing with 7 additions and 5 deletions.
  1. +7 −5 libcontainerd/client_local_windows.go
@@ -174,6 +174,7 @@ func (c *client) createWindows(id string, spec *specs.Spec, runtimeOptions inter
IgnoreFlushesDuringBoot: spec.Windows.IgnoreFlushesDuringBoot,
HostName: spec.Hostname,
HvPartition: false,
MemoryMaximumInMB: 4096,
}

c.extractResourcesFromSpec(spec, configuration)
@@ -373,6 +374,7 @@ func (c *client) createLinux(id string, spec *specs.Spec, runtimeOptions interfa
ContainerType: "linux",
Owner: defaultOwner,
TerminateOnLastHandleClosed: true,
MemoryMaximumInMB: 4096,
}

if lcowConfig.ActualMode == opengcs.ModeActualVhdx {
@@ -599,11 +601,11 @@ func (c *client) extractResourcesFromSpec(spec *specs.Spec, configuration *hcssh
configuration.ProcessorMaximum = int64(*spec.Windows.Resources.CPU.Maximum)
}
}
if spec.Windows.Resources.Memory != nil {
if spec.Windows.Resources.Memory.Limit != nil {
configuration.MemoryMaximumInMB = int64(*spec.Windows.Resources.Memory.Limit) / 1024 / 1024
}
}
// if spec.Windows.Resources.Memory != nil {
// if spec.Windows.Resources.Memory.Limit != nil {
// configuration.MemoryMaximumInMB = int64(*spec.Windows.Resources.Memory.Limit) / 1024 / 1024
// }
// }
}
}

0 comments on commit cf55f29

Please sign in to comment.
You can’t perform that action at this time.