Browse Source

[fedora-atomic][k8s] Fix missing internal IP

This is a missing case after we fixed[1]. When user passing in
an existing network when creating cluster, the network name is
missed in the code. This patch fixes it.

[1] https://review.opendev.org/678067

Task: 36430
Story: 2005333

Change-Id: I3a005089c4a755812c40589d8fa1e3ab7bbf062d
changes/97/679697/3
Feilong Wang 3 years ago
parent
commit
c3bce488d7
  1. 5
      magnum/drivers/heat/k8s_template_def.py
  2. 2
      magnum/tests/unit/drivers/test_template_definition.py

5
magnum/drivers/heat/k8s_template_def.py

@ -140,7 +140,10 @@ class K8sTemplateDefinition(template_def.BaseTemplateDefinition):
# accepts a name as an argument to internal-network-name in the
# cloud-config file provided to it. The default fixed network name is
# the same as that defined in the heat template.
fixed_network = cluster_template.fixed_network or "private"
fixed_network = (cluster.fixed_network or
cluster_template.fixed_network or
"private")
extra_params['fixed_network_name'] = \
neutron.get_fixed_network_name(context, fixed_network)

2
magnum/tests/unit/drivers/test_template_definition.py

@ -424,6 +424,7 @@ class AtomicK8sTemplateDefinitionTestCase(BaseK8sTemplateDefinitionTestCase):
fixed_network = '5d12f6fd-a196-4bf0-ae4c-1f639a523a52'
mock_cluster_template.fixed_network = fixed_network
mock_cluster = mock.MagicMock()
mock_cluster.fixed_network = None
mock_cluster.uuid = '5d12f6fd-a196-4bf0-ae4c-1f639a523a52'
del mock_cluster.stack_id
mock_osc = mock.MagicMock()
@ -852,6 +853,7 @@ class AtomicK8sTemplateDefinitionTestCase(BaseK8sTemplateDefinitionTestCase):
fixed_network_name = 'fixed_network'
mock_cluster_template.fixed_network = fixed_network_name
mock_cluster = mock.MagicMock()
mock_cluster.fixed_network = None
mock_cluster.uuid = '5d12f6fd-a196-4bf0-ae4c-1f639a523a52'
del mock_cluster.stack_id
mock_osc = mock.MagicMock()

Loading…
Cancel
Save