Merge pull request #636 from Random-Liu/fix-default-config

Only overwrite when legacy options are specified.
This commit is contained in:
Lantao Liu 2018-03-02 17:51:38 -08:00 committed by GitHub
commit 64b098a293
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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