From 89b1b50d3893b0bda6680e65bd2cc8bbaeb550e1 Mon Sep 17 00:00:00 2001 From: liyuanr Date: Thu, 8 Dec 2022 16:08:46 +0800 Subject: [PATCH] KubeOS:fix usage does not print when an error occurs in the upgrade image creation Fix the bug that the usage does not print when the upgrade image has parameter errors Signed-off-by: liyuanr --- ...-does-not-print-when-an-error-occurs.patch | 29 +++++++++++++++++++ KubeOS.spec | 9 +++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 0007-KubeOS-fix-usage-does-not-print-when-an-error-occurs.patch diff --git a/0007-KubeOS-fix-usage-does-not-print-when-an-error-occurs.patch b/0007-KubeOS-fix-usage-does-not-print-when-an-error-occurs.patch new file mode 100644 index 0000000..b17ed40 --- /dev/null +++ b/0007-KubeOS-fix-usage-does-not-print-when-an-error-occurs.patch @@ -0,0 +1,29 @@ +From 20f66b28ea95e262f54cad1a9b65d564f91b8d12 Mon Sep 17 00:00:00 2001 +From: liyuanr +Date: Thu, 8 Dec 2022 15:08:52 +0800 +Subject: [PATCH] KubeOS:fix usage does not print when an error occurs in the + upgrade image creation + +Fix the bug that the usage does not print +when the upgrade image has parameter errors + +Signed-off-by: liyuanr +--- + scripts/kbimg.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/scripts/kbimg.sh b/scripts/kbimg.sh +index a623e3d..a860c06 100644 +--- a/scripts/kbimg.sh ++++ b/scripts/kbimg.sh +@@ -125,6 +125,7 @@ function verify_upgrade_image_input() { + echo "$@" | grep -q "\-$i " + if [ "$?" -ne 0 ];then + log_error_print "option -$i is mandatory, please check input" ++ show_upgrade_image_usage + exit 3 + fi + done +-- +2.33.0.windows.2 + diff --git a/KubeOS.spec b/KubeOS.spec index 9cd4772..6f50813 100644 --- a/KubeOS.spec +++ b/KubeOS.spec @@ -2,7 +2,7 @@ Name: KubeOS Version: 1.0.2 -Release: 7 +Release: 8 Summary: O&M platform used to update the whole OS as an entirety License: Mulan PSL v2 Source0: https://gitee.com/openeuler/KubeOS/repository/archive/v%{version}.tar.gz @@ -12,6 +12,7 @@ Patch3: 0003-KubeOS-fixed-the-issue-of-VMs-images-and-add-check-o.patch Patch4: 0004-KubeOS-add-the-clearing-of-space-before-the-upgrade-.patch Patch5: 0005-KubeOS-add-the-configuration-of-etc-resolv.conf-and-.patch Patch6: 0006-KubeOS-remove-grub2-legacy-install-add-error-handlin.patch +Patch7: 0007-KubeOS-fix-usage-does-not-print-when-an-error-occurs.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: make BuildRequires: golang >= 1.13 @@ -112,6 +113,12 @@ install -p -m 0600 ./files/os-release %{buildroot}/opt/kubeOS/files rm -rfv %{buildroot} %changelog +* Thu Dec 08 2022 liyuanrong - 1.0.2-8 +- Type:requirement +- CVE:NA +- SUG:restart +- DESC:fix usage does not print when an error occurs in the upgrade image creation + * Tue Nov 29 2022 liyuanrong - 1.0.2-7 - Type:requirement - CVE:NA