Fix coe_version for k8s driver
Now the coe_version is out of sync with the k8s version deployed for the cluster. This patch will make sure the kube_version is consistent with the kube_tag when creating the cluster and upgrading the cluster. Task: 33608 Story: 2002210 Change-Id: I5812dac340099ecd8923c1e4a60ce0e6611f7ca4
This commit is contained in:
parent
05c27f2d73
commit
dc100551e4
magnum
drivers
tests/unit/drivers
releasenotes/notes
@ -180,6 +180,11 @@ class K8sTemplateDefinition(template_def.BaseTemplateDefinition):
|
||||
extra_params['registry_container'] = (
|
||||
CONF.docker_registry.swift_registry_container)
|
||||
|
||||
kube_tag = (cluster.labels.get("kube_tag") or
|
||||
cluster_template.labels.get("kube_tag"))
|
||||
if kube_tag:
|
||||
extra_params['kube_version'] = kube_tag
|
||||
|
||||
return super(K8sTemplateDefinition,
|
||||
self).get_params(context, cluster_template, cluster,
|
||||
extra_params=extra_params,
|
||||
|
@ -86,6 +86,7 @@ class Driver(driver.HeatDriver):
|
||||
# rebuild then do the k8s upgrade again, when both image id and
|
||||
# kube_tag changed
|
||||
heat_params["kube_tag"] = cluster_template.labels["kube_tag"]
|
||||
heat_params["kube_version"] = cluster_template.labels["kube_tag"]
|
||||
heat_params["master_kube_tag"] = cluster_template.labels["kube_tag"]
|
||||
heat_params["minion_kube_tag"] = cluster_template.labels["kube_tag"]
|
||||
heat_params["update_max_batch_size"] = max_batch_size
|
||||
|
@ -604,6 +604,7 @@ class AtomicK8sTemplateDefinitionTestCase(BaseK8sTemplateDefinitionTestCase):
|
||||
'traefik_ingress_controller_tag': traefik_ingress_controller_tag,
|
||||
'master_image': master_image,
|
||||
'minion_image': minion_image,
|
||||
'kube_version': kube_tag,
|
||||
}}
|
||||
mock_get_params.assert_called_once_with(mock_context,
|
||||
mock_cluster_template,
|
||||
@ -1005,6 +1006,7 @@ class AtomicK8sTemplateDefinitionTestCase(BaseK8sTemplateDefinitionTestCase):
|
||||
'traefik_ingress_controller_tag': traefik_ingress_controller_tag,
|
||||
'master_image': master_image,
|
||||
'minion_image': minion_image,
|
||||
'kube_version': kube_tag,
|
||||
}}
|
||||
mock_get_params.assert_called_once_with(mock_context,
|
||||
mock_cluster_template,
|
||||
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
The coe_version was out of sync with the k8s version deployed
|
||||
for the cluster. Now it is fixed by making sure the kube_version is
|
||||
consistent with the kube_tag when creating the cluster and upgrading
|
||||
the cluster.
|
Loading…
x
Reference in New Issue
Block a user