func NewWithConfig(config *config.NSPConfig) (*NetworkSecurityProbe, error) {
	var err error
	nsp := NetworkSecurityProbe{
		Config:       config,
		wg:           &sync.WaitGroup{},
		KubeInformer: &informer.SecurityProfileInformer{},
	}
	if config.CLI.KubeConfigPath != "" {
		nsp.KubeConfig, err = clientcmd.BuildConfigFromFlags("", config.CLI.KubeConfigPath)
		if err != nil {
			return nil, err
		}
	} else {
		nsp.KubeConfig, err = rest.InClusterConfig()
		if err != nil {
			return nil, err
		}
	}
	return &nsp, nil
}
// NewWithConfig - Returns a new NetworkSecurityProbe instance with the provided config
Returns a new NetworkSecurityProbe instance with the provided config
// NewWithConfig - Returns a new NetworkSecurityProbe instance with the provided config
func NewWithConfig(config *config.NSPConfig) (*NetworkSecurityProbe, error) {
	var err error
	nsp := NetworkSecurityProbe{
		Config:       config,
		wg:           &sync.WaitGroup{},
		KubeInformer: &informer.SecurityProfileInformer{},
	}
	if config.CLI.KubeConfigPath != "" {
		nsp.KubeConfig, err = clientcmd.BuildConfigFromFlags("", config.CLI.KubeConfigPath)
		if err != nil {
			return nil, err
		}
	} else {
		nsp.KubeConfig, err = rest.InClusterConfig()
		if err != nil {
			return nil, err
		}
	}
	return &nsp, nil
}
func NewWithConfig ( config * config . NSPConfig ) ( * NetworkSecurityProbe , error ) { var err error nsp := NetworkSecurityProbe { Config : config , wg : & sync . WaitGroup { } , KubeInformer : & informer . SecurityProfileInformer { } , } if config . CLI . KubeConfigPath != " " { nsp . KubeConfig , err = clientcmd . BuildConfigFromFlags ( " " , config . CLI . KubeConfigPath ) if err != nil { return nil , err } } else { nsp . KubeConfig , err = rest . InClusterConfig ( ) if err != nil { return nil , err } } return & nsp , nil }
Returns a new NetworkSecurityProbe instance with the provided config
Returns a new NetworkSecurityProbe instance with the provided config