Add a flag to set OOMScore

fix #337
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
This commit is contained in:
yanxuean
2017-10-12 16:07:57 +08:00
parent 885024f987
commit 3887b0a1a0
2 changed files with 10 additions and 0 deletions

View File

@@ -82,6 +82,8 @@ type Config struct {
StatsCollectPeriod int `toml:"stats_collect_period"`
// SystemdCgroup enables systemd cgroup support.
SystemdCgroup bool `toml:"systemd_cgroup"`
// OOMScore adjust the cri-containerd's oom score
OOMScore int `toml:"oom_score"`
}
// CRIContainerdOptions contains cri-containerd command line and toml options.
@@ -143,6 +145,8 @@ func (c *CRIContainerdOptions) AddFlags(fs *pflag.FlagSet) {
false, "Enables systemd cgroup support. By default not enabled.")
fs.BoolVar(&c.PrintDefaultConfig, "default-config",
false, "Print default toml config of cri-containerd and quit.")
fs.IntVar(&c.OOMScore, "oom-score",
-999, "Adjust the cri-containerd's oom score.")
}
// InitFlags must be called after adding all cli options flags are defined and