harvester / pcidevices

Manage PCI Devices and PCI Device Claims for PCI Passthrough in Harvester

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

attemptToEnablePassthrough func return object conflict

Captured77 opened this issue · comments

The modification suggestions are as follows:

retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error {
		newPdc, err := h.pdcClient.Get(pdc.Name, metav1.GetOptions{})
		if err != nil {
			return err
		}
		newPdc.Status.KernelDriverToUnbind = pd.Status.KernelDriverInUse
		newPdc.Status.PassthroughEnabled = true
		newPdc, err = h.pdcClient.UpdateStatus(newPdc)
		if err != nil {
			return err
		}
		return nil
	})