Respect --force-bind flag in virtctl image-upload
With this flag WaitForFirstConsumer logic is supposed to be ignored. No
need to immediately return an error if a DataVolume is in that phase.
@@ -445,7 +445,7 @@ func waitDvUploadScheduled(client kubecli.KubevirtClient, namespace, name string
return false, err
}
- if dv.Status.Phase == cdiv1.WaitForFirstConsumer {
+ if dv.Status.Phase == cdiv1.WaitForFirstConsumer && !forceBind {
return false, fmt.Errorf("cannot upload to DataVolume in WaitForFirstConsumer state, make sure the PVC is Bound")
}
// TODO: can check Condition/Event here to provide user with some error messages
