Recent changes [1] to AppImageParser _find_images_in_dict and
generate_download_images_list methods made this code to break with both
AttributeError and TypeError when stx-openstack application is being
uploaded.
This change includes extra protection against these types of errors and
restablish the flow for generating stx-openstack image list based on its
overrides.
It also adds a new image resource to TestKubeAppImageParser unit tests,
using an Openstack resource extracted from when debugging the original
error. It should prevent this issue to happen again for future changes
at AppImageParser logic.
The original change to generate_download_images_list, for example, would
fail the test:
* TestKubeAppImageParser.test_generate_download_images_list
Reviewed: https:/ /review. opendev. org/c/starlingx /config/ +/859671 /opendev. org/starlingx/ config/ commit/ 78040d2017c1edc f9f173af3e40849 9b23913529
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 78040d2017c1edc f9f173af3e40849 9b23913529
Author: Thales Elero Cervi <email address hidden>
Date: Wed Sep 28 14:49:07 2022 -0300
Add type checks to AppImageParser
Recent changes [1] to AppImageParser _find_images_ in_dict and download_ images_ list methods made this code to break with both
generate_
AttributeError and TypeError when stx-openstack application is being
uploaded.
This change includes extra protection against these types of errors and
restablish the flow for generating stx-openstack image list based on its
overrides.
It also adds a new image resource to TestKubeAppImag eParser unit tests, download_ images_ list, for example, would eParser. test_generate_ download_ images_ list
using an Openstack resource extracted from when debugging the original
error. It should prevent this issue to happen again for future changes
at AppImageParser logic.
The original change to generate_
fail the test:
* TestKubeAppImag
[1] https:/ /review. opendev. org/c/starlingx /config/ +/858762
Test Plan: eParser
PASS - Locally execute unit tests: TestKubeAppImag
PASS - Build the sysinv package with this change
PASS - Upload stx-openstack app
PASS - Apply stx-openstack app
Closes-Bug: 1991115
Signed-off-by: Thales Elero Cervi <email address hidden> 8a893249853cbea e3a9d3661e0
Change-Id: I8a1384bfefd12f