// Validate is the main entry point for network configuration validation.
// The parameter `onExecution` specifies if the validation should include
// execution checks. It returns an `error` on validation failure, otherwise
// `nil`.
Validate is the main entry point for network configuration validation.
The parameter `onExecution` specifies if the validation should include
execution checks. It returns an `error` on validation failure, otherwise
`nil`.
// Validate is the main entry point for network configuration validation . // The parameter ` onExecution ` specifies if the validation should include // execution checks . It returns an ` error ` on validation failure otherwise // ` nil ` .
func (c *NetworkConfig) Validate() error {
	if c.NetworkConfigDir != cniConfigDir {
		err := isDirectory(c.NetworkConfigDir)
		if err != nil {
			return errors.Wrapf(err, "invalid network_config_dir: %s", c.NetworkConfigDir)
		}
	}
	if stringsEq(c.CNIPluginDirs, cniBinDir) {
		return nil
	}
	for _, pluginDir := range c.CNIPluginDirs {
		if err := isDirectory(pluginDir); err == nil {
			return nil
		}
	}
	return errors.Errorf("invalid cni_plugin_dirs: %s", strings.Join(c.CNIPluginDirs, ","))
}
func ( c * NetworkConfig ) Validate ( ) error { if c . NetworkConfigDir != cniConfigDir { err := isDirectory ( c . NetworkConfigDir ) if err != nil { return errors . Wrapf ( err , " " , c . NetworkConfigDir ) } } if stringsEq ( c . CNIPluginDirs , cniBinDir ) { return nil } for _ , pluginDir := range c . CNIPluginDirs { if err := isDirectory ( pluginDir ) ; err == nil { return nil } } return errors . Errorf ( " " , strings . Join ( c . CNIPluginDirs , " " ) ) }
Validate is the main entry point for network configuration validation.
Validate is the main entry point for network configuration validation .