Only overwrite when legacy options are specified.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu 2018-03-02 19:41:20 +00:00
parent ba6503870f
commit ef5b9d1e16

View File

@ -204,8 +204,12 @@ func (c *CRIContainerdOptions) InitFlags(fs *pflag.FlagSet) error {
}
// Add this for backward compatibility.
// TODO(random-liu): Remove this when we no longer support cri-containerd standalone mode.
if c.ContainerdConfig.RootDir != "" {
c.ContainerdRootDir = c.ContainerdConfig.RootDir
}
if c.ContainerdConfig.Endpoint != "" {
c.ContainerdEndpoint = c.ContainerdConfig.Endpoint
}
// What is the reason for applying the command line twice?
// Because the values from command line have the highest priority.