Skip to content

Commit 45feedc

Browse files
jmealoZerpet
andauthored
Apply suggestions from code review
Co-authored-by: Aitor Pérez Cedres <1515757+Zerpet@users.noreply.github.com>
1 parent 1a2bb15 commit 45feedc

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

controllers/reconcile_persistence.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ func (r *RabbitmqClusterReconciler) reconcilePVC(ctx context.Context, rmq *rabbi
1616
logger := ctrl.LoggerFrom(ctx)
1717
desiredCapacity, err := persistenceStorageCapacity(desiredSts.Spec.VolumeClaimTemplates)
1818
if err != nil {
19-
msg := fmt.Sprintf("Failed to determine PVC capacity: %s", err.Error())
20-
logger.Error(err, msg)
19+
logger.Error(err, "failed to determine PVC capacity")
2120
r.Recorder.Event(rmq, corev1.EventTypeWarning, "FailedReconcilePersistence", msg)
2221
return err
2322
}
@@ -36,10 +35,8 @@ func persistenceStorageCapacity(templates []corev1.PersistentVolumeClaim) (k8sre
3635
storage := t.Spec.Resources.Requests[corev1.ResourceStorage]
3736
if storage.IsZero() {
3837
return storage, fmt.Errorf(
39-
"PVC template 'persistence' has spec.resources.requests.storage=0 (or missing). " +
40-
"If using override.statefulSet.spec.volumeClaimTemplates, you must provide " +
41-
"the COMPLETE template including spec.resources.requests.storage. " +
42-
"Overrides replace the entire volumeClaimTemplate, not merge with it")
38+
"PVC template 'persistence' is missing the storage request. " +
39+
"If you are overriding the persistence template, please provide the full template definition including storage request and metadata")
4340
}
4441
return storage, nil
4542
}

0 commit comments

Comments
 (0)