func (discovery *DeviceDiscovery) updateStatus() error {
	truncatedNodeName := truncateNodeName(resultCRName, os.Getenv("MY_NODE_NAME"))
	resultCR, err := discovery.apiClient.GetDiscoveryResult(truncatedNodeName, os.Getenv("WATCH_NAMESPACE"))
	if err != nil {
		if kerrors.IsNotFound(err) {
			klog.Warning("result resource not found. Ignoring since object must be deleted.")
			return nil
		}
		return errors.Wrapf(err, "failed to retrieve LocalVolumeDiscoveryResult resource to update status")
	}

	// Update discovered devce list and discovery time
	resultCR.Status.DiscoveredDevices = discovery.disks
	resultCR.Status.DiscoveredTimeStamp = time.Now().UTC().Format(time.RFC3339)

	err = discovery.apiClient.UpdateDiscoveryResultStatus(resultCR)
	if err != nil {
		return errors.Wrapf(err, "failed to update the device status in the LocalVolumeDiscoveryResult resource")
	}

	return nil
}
// updateStatus updates the LocalVolumeDiscoveryResult resource status
updateStatus updates the LocalVolumeDiscoveryResult resource status
// updateStatus updates the LocalVolumeDiscoveryResult resource status
func (discovery *DeviceDiscovery) updateStatus() error {
	truncatedNodeName := truncateNodeName(resultCRName, os.Getenv("MY_NODE_NAME"))
	resultCR, err := discovery.apiClient.GetDiscoveryResult(truncatedNodeName, os.Getenv("WATCH_NAMESPACE"))
	if err != nil {
		if kerrors.IsNotFound(err) {
			klog.Warning("result resource not found. Ignoring since object must be deleted.")
			return nil
		}
		return errors.Wrapf(err, "failed to retrieve LocalVolumeDiscoveryResult resource to update status")
	}
	resultCR.Status.DiscoveredDevices = discovery.disks
	resultCR.Status.DiscoveredTimeStamp = time.Now().UTC().Format(time.RFC3339)
	err = discovery.apiClient.UpdateDiscoveryResultStatus(resultCR)
	if err != nil {
		return errors.Wrapf(err, "failed to update the device status in the LocalVolumeDiscoveryResult resource")
	}
	return nil
}
func ( discovery * DeviceDiscovery ) updateStatus ( ) error { truncatedNodeName := truncateNodeName ( resultCRName , os . Getenv ( " " ) ) resultCR , err := discovery . apiClient . GetDiscoveryResult ( truncatedNodeName , os . Getenv ( " " ) ) if err != nil { if kerrors . IsNotFound ( err ) { klog . Warning ( " " ) return nil } return errors . Wrapf ( err , " " ) } resultCR . Status . DiscoveredDevices = discovery . disks resultCR . Status . DiscoveredTimeStamp = time . Now ( ) . UTC ( ) . Format ( time . RFC3339 ) err = discovery . apiClient . UpdateDiscoveryResultStatus ( resultCR ) if err != nil { return errors . Wrapf ( err , " " ) } return nil }
updateStatus updates the LocalVolumeDiscoveryResult resource status
updateStatus updates the LocalVolumeDiscoveryResult resource status
// Update discovered devce list and discovery time