update c/common to latest

This contains changes that are needed to enable netavark e2e testing.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2022-01-17 15:58:45 +01:00
parent 8514ebd182
commit 06ad51c83b
7 changed files with 88 additions and 42 deletions

View File

@@ -822,21 +822,6 @@ func (c *ContainersConfig) Validate() error {
// execution checks. It returns an `error` on validation failure, otherwise
// `nil`.
func (c *NetworkConfig) Validate() error {
expectedConfigDir := _cniConfigDir
if unshare.IsRootless() {
home, err := unshare.HomeDir()
if err != nil {
return err
}
expectedConfigDir = filepath.Join(home, _cniConfigDirRootless)
}
if c.NetworkConfigDir != expectedConfigDir {
err := isDirectory(c.NetworkConfigDir)
if err != nil && !os.IsNotExist(err) {
return errors.Wrapf(err, "invalid network_config_dir: %s", c.NetworkConfigDir)
}
}
if stringsEq(c.CNIPluginDirs, DefaultCNIPluginDirs) {
return nil
}