7bd361b69b
Add the folowing enhancements to application updates during Kubernetes upgrades: 1) Move the pre application update logic from kube-upgrade-start step to a specific separated step called via a new command line option named kube-pre-application-update, which can be triggered after the download images step and before upgrading networking. 2) Move the post application update logic from kube-upgrade-complete step to a specific separated step called via a new command line option named kube-post-application-update, which can be triggered after the kube-upgrade-complete stage and before the upgrade is deleted. 3) Introduce validation logic to kube-upgrade-start step to check if all applied apps have available versions compatible with intermediate and target Kubernetes versions. Upgrades are blocked if apps marked to be pre updated are incompatible with current and target Kubernetes versions. Upgrades are also blocked if apps marked to be post updated are incompatible with the target Kubernetes version. 4) Delete uploaded applications incompatible with the target Kubernetes version and upload one that is compatible if available. 5) Restore kube-upgrade-start and kube-upgrade-complete to their original logic before application updates during Kubernetes upgrades was implemented on task 49416. The kube-upgrade-start step is synchronous as it used to be before that change. 6) Update sysinv and cgts-client unit tests to account for the new Kubernetes upgrade steps. 7) Create a helper function called "patch_kube_upgrade" to improve code reuse when creating patch requests for new shell commands related to Kubernetes upgrades. Test Plan: AIO-SX Test Cases: PASS: Fresh install. PASS: Successful Kubernetes single version upgrade with no apps that need to be updated. PASS: Successful Kubernetes multi-version upgrade with no apps that need to be updated. PASS: Successful Kubernetes upgrade with apps that need to be updated before and after the new version is deployed. PASS: Check if the upgrade is blocked if an app is incompatible with a Kubernetes intermediate version during a multi-version upgrade. PASS: Check if the upgrade is blocked if an app marked to be pre updated is incompatible with the Kubernetes target version. PASS: Check if the upgrade is blocked if an app marked to be post updated is incompatible with the Kubernetes target version. PASS: Check if uploaded apps have been replaced by compatible versions. PASS: Check if uploaded apps that do not have compatible versions were removed. PASS: Failure to run kube-pre-application-update and successful retry. PASS: Failure to run kube-post-application-update and successful retry. PASS: Abort during kube-pre-application-update and start over. PASS: Reject aborting Kubernetes upgrade after post-updated-apps state. AIO-DX Test Cases: PASS: Fresh install. PASS Successful Kubernetes upgrade with no apps that need to be updated. PASS: Successful Kubernetes upgrade with apps that need to be updated before and after the new version is deployed. PASS: Check if the upgrade is blocked if an app marked to be pre updated is incompatible with the Kubernetes target version. PASS: Check if the upgrade is blocked if an app marked to be post updated is incompatible with the Kubernetes target version. Story: 2010929 Task: 49595 Change-Id: I9b48567c39c9a12b7563d56ab90fbfe9dd7082aa Signed-off-by: Igor Soares <Igor.PiresSoares@windriver.com> |
||
---|---|---|
.. | ||
v1 | ||
__init__.py | ||
test_shell.py | ||
test_utils.py | ||
utils.py |