func NewDeviceDiscovery() (*DeviceDiscovery, error) {
	scheme := scheme.Scheme
	apis.AddToScheme(scheme)
	apiUpdater, err := diskmaker.NewAPIUpdater(scheme)
	if err != nil {
		klog.Error(err, "failed to create new APIUpdater")
		return &DeviceDiscovery{}, err
	}

	dd := &DeviceDiscovery{}
	dd.apiClient = apiUpdater
	dd.eventSync = diskmaker.NewEventReporter(dd.apiClient)
	lvd, err := dd.apiClient.GetLocalVolumeDiscovery(localVolumeDiscoveryComponent, os.Getenv("WATCH_NAMESPACE"))
	if err != nil {
		klog.Error(err, "failed to get LocalVolumeDiscovery object")
		return &DeviceDiscovery{}, err
	}
	dd.localVolumeDiscovery = lvd
	return dd, nil
}
// NewDeviceDiscovery returns a new DeviceDiscovery instance
NewDeviceDiscovery returns a new DeviceDiscovery instance
// NewDeviceDiscovery returns a new DeviceDiscovery instance
func NewDeviceDiscovery() (*DeviceDiscovery, error) {
	scheme := scheme.Scheme
	apis.AddToScheme(scheme)
	apiUpdater, err := diskmaker.NewAPIUpdater(scheme)
	if err != nil {
		klog.Error(err, "failed to create new APIUpdater")
		return &DeviceDiscovery{}, err
	}
	dd := &DeviceDiscovery{}
	dd.apiClient = apiUpdater
	dd.eventSync = diskmaker.NewEventReporter(dd.apiClient)
	lvd, err := dd.apiClient.GetLocalVolumeDiscovery(localVolumeDiscoveryComponent, os.Getenv("WATCH_NAMESPACE"))
	if err != nil {
		klog.Error(err, "failed to get LocalVolumeDiscovery object")
		return &DeviceDiscovery{}, err
	}
	dd.localVolumeDiscovery = lvd
	return dd, nil
}
func NewDeviceDiscovery ( ) ( * DeviceDiscovery , error ) { scheme := scheme . Scheme apis . AddToScheme ( scheme ) apiUpdater , err := diskmaker . NewAPIUpdater ( scheme ) if err != nil { klog . Error ( err , " " ) return & DeviceDiscovery { } , err } dd := & DeviceDiscovery { } dd . apiClient = apiUpdater dd . eventSync = diskmaker . NewEventReporter ( dd . apiClient ) lvd , err := dd . apiClient . GetLocalVolumeDiscovery ( localVolumeDiscoveryComponent , os . Getenv ( " " ) ) if err != nil { klog . Error ( err , " " ) return & DeviceDiscovery { } , err } dd . localVolumeDiscovery = lvd return dd , nil }
NewDeviceDiscovery returns a new DeviceDiscovery instance
NewDeviceDiscovery returns a new DeviceDiscovery instance