From 441a316548d7f5066391fea6dc2181c5cc747e3a Mon Sep 17 00:00:00 2001 From: Gerd Oberlechner Date: Mon, 4 Mar 2024 10:14:30 +0100 Subject: [PATCH] fix condition in get_pool_spec_to_update Signed-off-by: Gerd Oberlechner --- reconcile/ocm_machine_pools.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/reconcile/ocm_machine_pools.py b/reconcile/ocm_machine_pools.py index 748d7b1dbd..4a9704b8fd 100644 --- a/reconcile/ocm_machine_pools.py +++ b/reconcile/ocm_machine_pools.py @@ -299,16 +299,17 @@ def get_pool_spec_to_update( if app-interface does not define a subnet explicitely or if the subnet is different from OCM, we consider the spec in app-interface oudated. - in such a case this method returns a clone of the current pool definition + In such a case this method returns a clone of the current pool definition in app-interface with the subnet updated to the one in OCM. if no update is required, None is returned - how can this happen? - * cluster gets created without specified subnets and ROSA CLI picks the subnet + How can this happen? + * a cluster was created without specified subnets and ROSA CLI picks the subnet assignment for the nodepools * nodepools have been recreated on OCM side without app-interface involvement + and the subnet changed """ - if pool.subnet is None and self.subnet != pool.subnet: + if pool.subnet is None or self.subnet != pool.subnet: return pool.copy(update={"subnet": self.subnet}) return None