Skip to content

Commit

Permalink
VRG: Fix PV name in messages
Browse files Browse the repository at this point in the history
Signed-off-by: hatfieldbrian <bhatfiel@redhat.com>
  • Loading branch information
hatfieldbrian authored and raghavendra-talur committed Jul 13, 2023
1 parent 0ee63f4 commit 015ae96
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions controllers/vrg_volrep.go
Original file line number Diff line number Diff line change
Expand Up @@ -1960,12 +1960,11 @@ func (v *VRGInstance) updateExistingPVForSync(pv *corev1.PersistentVolume) error
}

func (v *VRGInstance) validateExistingPV(pv *corev1.PersistentVolume) error {
existingPV := &corev1.PersistentVolume{}
log := v.log.WithValues("PV", existingPV.GetName())
log := v.log.WithValues("PV", pv.Name)

err := v.reconciler.Get(v.ctx, types.NamespacedName{Name: pv.Name}, existingPV)
if err != nil {
return fmt.Errorf("failed to get PV (%s) (%w)", existingPV.GetName(), err)
existingPV := &corev1.PersistentVolume{}
if err := v.reconciler.Get(v.ctx, types.NamespacedName{Name: pv.Name}, existingPV); err != nil {
return fmt.Errorf("failed to get PV %s: %w", pv.Name, err)
}

if existingPV.Status.Phase == corev1.VolumeBound {
Expand Down

0 comments on commit 015ae96

Please sign in to comment.