[magnum] error when trying to overwrite master_lb_enabled in cluster create

Ionut Biru ionut at fleio.com
Mon Oct 19 10:34:19 UTC 2020


Hi guys,

In template i have master_lb_disabled and i want to overwrite this option
using:

ยป openstack coe cluster create cluster002 --cluster-template
b7e0be01-bf3b-4c32-af60-98b9edefa0be --keypair ioni --master-count 2
--node-count 2 --master-lb-enabled

master_count must be 1 when master_lb_enabled is False (HTTP 400)
(Request-ID: req-608b8634-d98e-4efd-b0e4-543ebc9eb315

Looking at the code
https://opendev.org/openstack/magnum/src/branch/master/magnum/api/controllers/v1/cluster.py#L552

https://opendev.org/openstack/magnum/src/branch/master/magnum/api/attr_validator.py#L210

It seems that the validator doesn't take in consideration the new cluster
dictionary.

I've modified the validator with:
cluster.get('master_lb_enabled', cluster_template['master_lb_enabled']):

and it seems to work fine

Not sure if it is the right fix.

-- 
Ionut Biru - https://fleio.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20201019/16bd4803/attachment.html>


More information about the openstack-discuss mailing list