Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
  • Loading branch information
arnongilboa committed Apr 29, 2023
1 parent 57ef88a commit 37f9791
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pkg/controller/datavolume/controller-base.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,17 @@ func (r *ReconcilerBase) syncDvPvcState(log logr.Logger, req reconcile.Request,
}
}

syncState.pvcSpec, err = renderPvcSpec(r.client, r.recorder, log, dv, syncState.pvc)
if err != nil {
if syncErr := r.syncDataVolumeStatusPhaseWithEvent(&syncState, cdiv1.PhaseUnset, nil,
Event{corev1.EventTypeWarning, cc.ErrClaimNotValid, err.Error()}); syncErr != nil {
log.Error(syncErr, "failed to sync DataVolume status with event")
if syncState.pvc == nil {
syncState.pvcSpec, err = renderPvcSpec(r.client, r.recorder, log, dv, syncState.pvc)
if err != nil {
if syncErr := r.syncDataVolumeStatusPhaseWithEvent(&syncState, cdiv1.PhaseUnset, nil,
Event{corev1.EventTypeWarning, cc.ErrClaimNotValid, err.Error()}); syncErr != nil {
log.Error(syncErr, "failed to sync DataVolume status with event")
}
return syncState, err
}
return syncState, err
} else {
syncState.pvcSpec = syncState.pvc.Spec.DeepCopy()
}

if err := r.handleStaticVolume(&syncState, log); err != nil || syncState.result != nil {
Expand Down

0 comments on commit 37f9791

Please sign in to comment.