diff --git a/magnum_cluster_api/driver.py b/magnum_cluster_api/driver.py index 2c64bb8f..4cd341ed 100644 --- a/magnum_cluster_api/driver.py +++ b/magnum_cluster_api/driver.py @@ -287,7 +287,15 @@ def update_nodegroup_status(self, context, cluster, nodegroup): def update_nodegroup(self, context, cluster, nodegroup): # TODO + # NOTE(okozachenko1203): First we save the nodegroup status because update_cluster_status() + # could be finished before update_nodegroup(). + nodegroup.save() resources.apply_cluster_from_magnum_cluster(context, self.k8s_api, cluster) + # NOTE(okozachenko1203): We set the cluster status as UPDATE_IN_PROGRESS again at the end because + # update_cluster_status() could be finished and cluster status has been set as + # UPDATE_COMPLETE before nodegroup_conductor.Handler.nodegroup_update finished. + cluster.status = "UPDATE_IN_PROGRESS" + cluster.save() def delete_nodegroup(self, context, cluster, nodegroup): nodegroup.status = "DELETE_IN_PROGRESS"