-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v1.3] Add addon version check with the repo #754
base: v1.3
Are you sure you want to change the base?
Conversation
Signed-off-by: Jian Wang <jian.wang@suse.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one small suggestion (apologies for missing this when reviewing #750)
fi | ||
done | ||
|
||
echo "all upgrade addons have matched version with the repo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we're not failing the build on mismatches per #750 (comment), this line will always be printed. Better to either print a count of mismatches, or maybe just not print this line at all, e.g.:
@@ -180,6 +180,7 @@ check_upgrade_addon_chart_version_matching() {
echo "upgrade addon files"
ls -alht ${harvester_path}/package/upgrade/addons
+ local mismatches=0
for filename in ${harvester_path}/package/upgrade/addons/*.yaml; do
local tmpfile=/tmp/$(basename ${filename})
grep -v "{{" ${filename} > ${tmpfile}
@@ -203,10 +204,13 @@ check_upgrade_addon_chart_version_matching() {
# a new version bumping generally means two PRs
# directly return 1 will cause failure in build
echo WARNING upgrade addon "$chart" has version mis-matching: in repo is "$repover" but in addon is "$version"
+ (( mismatches +=1 ))
fi
done
- echo "all upgrade addons have matched version with the repo"
+ if [[ $mismatches -eq 0 ]]; then
+ echo "all upgrade addons have matched version with the repo"
+ fi
}
check_upgrade_addon_chart_version_matching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
echo WARNING: addon $chart is defined, but the chart is not packed into repo / repo struct is changed | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the indention is 1 space instead of 2spaces.
echo WARNING: addon "$chart" is defined with version "$version" but the chart is not packed into repo in ${ARCH} | ||
elif [[ $repover != $version ]]; then | ||
echo addon "$chart" has version mis-matching: in repo is "$repover" but in addon is "$version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
echo WARNING: upgrade addon $chart is defined, but the chart is not packed into repo / repo struct is changed | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
echo WARNING: upgrade addon "$chart" is defined with version "$version" but the chart is not packed into repo in ${ARCH} | ||
elif [[ $repover != $version ]]; then | ||
# the upgrade addon is stored in GH harvester; but the chart repo is stored in GH harvester-installer | ||
# a new version bumping generally means two PRs | ||
# directly return 1 will cause failure in build | ||
echo WARNING upgrade addon "$chart" has version mis-matching: in repo is "$repover" but in addon is "$version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
Problem:
Addon & repo chart version mis-matching (e.g. harvester/harvester#5840)
Solution:
Check version matching in the step of build-bundle
In amd64 architecture, the mismatching will cause build failure
In arm64 architecture, the mismatching will print some WARNING messages but build continue
Related Issue:
harvester/harvester#4937
harvester/harvester#5840
Test plan:
Refer #750 (comment)
This is a manual backport of #750, as the addon upgrade path is changed in master-head.