core: use updated context in prevalidaiton checks

If the CephCluster spec is updated before the prevalidation check, then
Cluster.context still refers to the cancelled context of the operator.
This PR just updates the cluster context to use the latest operator
context.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
This commit is contained in:
Santosh Pillai committed 2025-09-16 12:57:12 +05:30
1 parent a05a49424a
commit 1ff7604f82
1 file changed
+1 -2
+1 -2
View File
@@ -264,6 +264,7 @@ func (c *ClusterController) initializeCluster(cluster *cluster) error {
}
func (c *ClusterController) configureLocalCephCluster(cluster *cluster) error {
cluster.ClusterInfo.Context = c.OpManagerCtx
// Cluster Spec validation
err := preClusterStartValidation(cluster)
if err != nil {
@@ -287,8 +288,6 @@ func (c *ClusterController) configureLocalCephCluster(cluster *cluster) error {
}
controller.UpdateCondition(c.OpManagerCtx, c.context, c.namespacedName, k8sutil.ObservedGenerationNotAvailable, cephv1.ConditionProgressing, v1.ConditionTrue, cephv1.ClusterProgressingReason, "Configuring the Ceph cluster")
cluster.ClusterInfo.Context = c.OpManagerCtx
// Run the orchestration
err = cluster.reconcileCephDaemons(c.rookImage, *cephVersion)
if err != nil {