vexxhost / magnum-cluster-api

Cluster API driver for OpenStack Magnum
Apache License 2.0
41 stars 16 forks source link

`KeyError: 'annotations'` during cluster updates #368

Closed mnaser closed 1 month ago

mnaser commented 2 months ago

https://github.com/vexxhost/magnum-cluster-api/blob/1f5defa34b54788982be933860504f2dbeb3b123/magnum_cluster_api/objects.py#L137-L140

This needs to assume that the annotations could be empty in the cases of no autoscaling:

2024-05-01 16:28:29.342 10 ERROR oslo_messaging.rpc.server KeyError: 'annotations'
2024-05-01 16:28:29.342 10 ERROR oslo_messaging.rpc.server self.obj["spec"]["template"]["metadata"]["annotations"]
2024-05-01 16:28:29.342 10 ERROR oslo_messaging.rpc.server File "/var/lib/openstack/lib/python3.10/site-packages/magnum_cluster_api/objects.py", line 138, in equals_spec
2024-05-01 16:28:29.342 10 ERROR oslo_messaging.rpc.server retry=retry_if_not_result(lambda md: md.equals_spec(target_md_spec)),
2024-05-01 16:28:29.342 10 ERROR oslo_messaging.rpc.server File "/var/lib/openstack/lib/python3.10/site-packages/magnum_cluster_api/driver.py", line 458, in <lambda>
2024-05-01 16:28:29.342 10 ERROR oslo_messaging.rpc.server return not self.predicate(retry_state.outcome.result())