Fixed third-party packages bug

With the introduction of the custom manifests
update [1], a new bug was found when third-party
packages were added to the project scope. This
new feature was ignoring all custom manifests
that were not part of the official build,
causing errors to happen when such packages
were used

[1] https://review.opendev.org/c/starlingx/root/+/938481

Test Plan:
- PASS: Build package with specific custom manifest
directory (/custom-manifests)
- PASS: Execute build-helm-charts.sh
- PASS: Compare diffs between official and merged manifests
- PASS: Apply generated tarball
- PASS: Execute any commands related to the third-party
package

Closes-Bug: 2095498

Change-Id: Id212e7dd63d7a6013f572a8c217fde6f1b663f9c
Signed-off-by: jbarboza <joaopedro.barbozalioneza@windriver.com>
This commit is contained in:
jbarboza
2025-01-22 17:01:34 -03:00
committed by João Pedro Barboza Lioneza
parent 0c21a13069
commit 3618d3046a

View File

@@ -305,15 +305,25 @@ function build_application_tarball_armada {
function compare_custom_manifests {
MANIFEST_LIST=$1
for manifest in ${MANIFEST_LIST}; do
if [ ! -s usr/lib/fluxcd/${manifest} ]; then
cp -R usr/lib/fluxcd/custom-manifests/${manifest} usr/lib/fluxcd/${manifest}
continue
fi
if [ -f usr/lib/fluxcd/custom-manifests/${manifest} ]; then
${PYTHON_2_OR_3} $BUILD_HELM_CHARTS_DIR/merge_manifests.py usr/lib/fluxcd/${manifest} usr/lib/fluxcd/custom-manifests/${manifest}
continue
fi
MAIN_MANIFESTS=$(ls usr/lib/fluxcd/${manifest})
CUSTOM_MANIFESTS=$(ls usr/lib/fluxcd/custom-manifests/${manifest})
for manifest_file in ${MAIN_MANIFESTS}; do
if [ ! -f usr/lib/fluxcd/custom-manifests/${manifest}/${manifest_file} ]; then
echo "Warning: missing ${manifest_file} in custom manifests"
else
${PYTHON_2_OR_3} $BUILD_HELM_CHARTS_DIR/merge_manifests.py usr/lib/fluxcd/${manifest}/${manifest_file} usr/lib/fluxcd/custom-manifests/${manifest}/${manifest_file}
fi
${PYTHON_2_OR_3} \
$BUILD_HELM_CHARTS_DIR/merge_manifests.py \
usr/lib/fluxcd/${manifest}/${manifest_file} \
usr/lib/fluxcd/custom-manifests/${manifest}/${manifest_file}
done
done
}