File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
pkg/inspecttypes/dockercompat Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ type HostConfig struct {
160
160
DNS []string `json:"Dns"` // List of DNS server to lookup
161
161
DNSOptions []string `json:"DnsOptions"` // List of DNSOption to look for
162
162
DNSSearch []string `json:"DnsSearch"` // List of DNSSearch to look for
163
+ OomScoreAdj int // specifies the tune container’s OOM preferences (-1000 to 1000, rootless: 100 to 1000)
163
164
}
164
165
165
166
// From https://github.com/moby/moby/blob/v20.10.1/api/types/types.go#L416-L427
@@ -446,6 +447,9 @@ func ContainerFromNative(n *native.Container) (*Container, error) {
446
447
c .HostConfig .DNSOptions = dnsSettings .DNSResolvConfOptions
447
448
c .HostConfig .DNSSearch = dnsSettings .DNSSearchDomains
448
449
450
+ oomScoreAdj , _ := getOomScoreAdjFromNative (n .Spec .(* specs.Spec ))
451
+ c .HostConfig .OomScoreAdj = oomScoreAdj
452
+
449
453
c .State = cs
450
454
c .Config = & Config {
451
455
Labels : n .Labels ,
@@ -728,6 +732,14 @@ func getDnsFromNative(Labels map[string]string) (*DNSSettings, error) {
728
732
return res , nil
729
733
}
730
734
735
+ func getOomScoreAdjFromNative (sp * specs.Spec ) (int , error ) {
736
+ var res int
737
+ if sp .Process != nil && sp .Process .OOMScoreAdj != nil {
738
+ res = * sp .Process .OOMScoreAdj
739
+ }
740
+ return res , nil
741
+ }
742
+
731
743
type IPAMConfig struct {
732
744
Subnet string `json:"Subnet,omitempty"`
733
745
Gateway string `json:"Gateway,omitempty"`
You can’t perform that action at this time.
0 commit comments