From 439548e3de4c698d74b8f4ac00207f5d5cedd314 Mon Sep 17 00:00:00 2001 From: guilhermesteinmuller Date: Mon, 30 Nov 2020 16:19:48 -0300 Subject: [PATCH] Fix ostree_* upgrade Currently, the code assumes that both ostree_commit and ostree_remote are present in cluster_template.labels. If one of them are missing, the ostree upgrade fails [1] and leaves the cluster with UPDATE_FAILED status. By the docs[2], it is understood that users have the ability to choose only one of the labels. [1] https://gist.github.com/guilhermesteinmuller/7bf9f51e421283783cf737900797232c [2] https://github.com/openstack/magnum/blob/master/doc/source/user/rolling-upgrade.rst Change-Id: I0f65169305ba74c082b65bf39083def278404b93 --- magnum/drivers/heat/driver.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/magnum/drivers/heat/driver.py b/magnum/drivers/heat/driver.py index a0bf499b51..5e67bd5e9a 100755 --- a/magnum/drivers/heat/driver.py +++ b/magnum/drivers/heat/driver.py @@ -332,6 +332,8 @@ class FedoraKubernetesDriver(KubernetesDriver): "valid kube_tag"), cluster_template.name) for ostree_tag in ["ostree_commit", "ostree_remote"]: + if ostree_tag not in cluster_template.labels: + continue try: ostree_param = { ostree_tag: cluster_template.labels[ostree_tag]