Skip to content

Commit

Permalink
fix(import-populator): Make copying of annotations more robust (#3388)
Browse files Browse the repository at this point in the history
Similar to 2fa5f27, make copying of annotations from a prime PVC to a
target PVC more robust, by doing it before rebinding the PV from prime
to target. This way we can ensure the annotations are already present
once the PVC becomes ready.

Signed-off-by: Felix Matouschek <[email protected]>
  • Loading branch information
0xFelix authored Aug 30, 2024
1 parent ca58b7a commit dd31547
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/controller/populators/import-populator.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ func (r *ImportPopulatorReconciler) reconcileTargetPVC(pvc, pvcPrime *corev1.Per
}

if cc.IsPVCComplete(pvcPrime) && cc.IsUnbound(pvc) {
// Once the import is succeeded, we copy labels and rebind the PV from PVC to target PVC
// Once the import is succeeded, we copy annotations and labels and rebind the PV from PVC to target PVC
if pvcCopy, err = r.updatePVCWithPVCPrimeAnnotations(pvcCopy, pvcPrime, r.updateImportAnnotations); err != nil {
return reconcile.Result{}, err
}
if pvcCopy, err = r.updatePVCWithPVCPrimeLabels(pvcCopy, pvcPrime.GetLabels()); err != nil {
return reconcile.Result{}, err
}
Expand Down

0 comments on commit dd31547

Please sign in to comment.