!87 KubeOS: bugs fix of pxe and admin-container

From: @weiy6 
Reviewed-by: @li-yuanrong 
Signed-off-by: @li-yuanrong
This commit is contained in:
openeuler-ci-bot 2024-12-11 07:51:07 +00:00 committed by Gitee
commit 0de262bd22
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 93 additions and 1 deletions

View File

@ -0,0 +1,26 @@
From dce6ad3578e0fef7d60e52d926db6835f6c437c0 Mon Sep 17 00:00:00 2001
From: Yuhang Wei <weiyuhang3@huawei.com>
Date: Wed, 11 Dec 2024 10:57:09 +0800
Subject: [PATCH 1/3] fix(kbimg): add return statement for non-existent disk
handling
Signed-off-by: Yuhang Wei <weiyuhang3@huawei.com>
---
KubeOS-Rust/kbimg/src/values.rs | 1 +
1 file changed, 1 insertion(+)
diff --git a/KubeOS-Rust/kbimg/src/values.rs b/KubeOS-Rust/kbimg/src/values.rs
index 3986c13f..c36cacb9 100644
--- a/KubeOS-Rust/kbimg/src/values.rs
+++ b/KubeOS-Rust/kbimg/src/values.rs
@@ -508,6 +508,7 @@ function GetDisk() {
echo "${disk} exists, start partition" | tee -a ${log}
else
echo "disk not exist, please choose correct disk" | tee -a ${log}
+ return 1
fi
else
echo "no disk found" | tee -a ${log}
--
2.39.5 (Apple Git-154)

View File

@ -0,0 +1,30 @@
From 44a3d151910e89c8e7337f32091b3581c84d6b32 Mon Sep 17 00:00:00 2001
From: Yuhang Wei <weiyuhang3@huawei.com>
Date: Wed, 11 Dec 2024 11:28:00 +0800
Subject: [PATCH 2/3] fix(kbimg): incorrect remove chroot script path
Signed-off-by: Yuhang Wei <weiyuhang3@huawei.com>
---
KubeOS-Rust/kbimg/src/custom.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/KubeOS-Rust/kbimg/src/custom.rs b/KubeOS-Rust/kbimg/src/custom.rs
index 55071bfa..85d10023 100644
--- a/KubeOS-Rust/kbimg/src/custom.rs
+++ b/KubeOS-Rust/kbimg/src/custom.rs
@@ -78,7 +78,11 @@ impl ChrootScript {
"#,
absolute_path.as_path().to_str().unwrap(),
script_name.to_str().unwrap(),
- if self.rm.unwrap_or(false) { format!("rm -f /{}", script_name.to_str().unwrap()) } else { "".to_string() }
+ if self.rm.unwrap_or(false) {
+ format!("rm -f \"${{RPM_ROOT}}\"/{}", script_name.to_str().unwrap())
+ } else {
+ "".to_string()
+ }
)?;
Ok(())
}
--
2.39.5 (Apple Git-154)

View File

@ -0,0 +1,27 @@
From 0c7c2b286556dcdbfac902e44a12c5f6a486a78c Mon Sep 17 00:00:00 2001
From: Yuhang Wei <weiyuhang3@huawei.com>
Date: Wed, 11 Dec 2024 12:02:46 +0800
Subject: [PATCH 3/3] fix(admin-container): correct path for copying files in
dockerfile
Signed-off-by: Yuhang Wei <weiyuhang3@huawei.com>
---
KubeOS-Rust/kbimg/src/values.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/KubeOS-Rust/kbimg/src/values.rs b/KubeOS-Rust/kbimg/src/values.rs
index c36cacb9..7cf322e1 100644
--- a/KubeOS-Rust/kbimg/src/values.rs
+++ b/KubeOS-Rust/kbimg/src/values.rs
@@ -845,7 +845,7 @@ CMD ["/bin/sh"]"#;
pub const ADMIN_DOCKERFILE_CONTENT: &str = r#"FROM openeuler/openeuler:24.03-lts
RUN dnf upgrade -y && dnf -y install openssh-clients util-linux sysmaster
-COPY ./set-ssh-pub-key.sh ./hostshell /usr/local/bin
+COPY ./set-ssh-pub-key.sh ./hostshell /usr/local/bin/
COPY ./set-ssh-pub-key.service /usr/lib/sysmaster/system
EXPOSE 22
RUN ln -s /usr/lib/sysmaster/system/set-ssh-pub-key.service /etc/sysmaster/system/multi-user.target.wants/set-ssh-pub-key.service
--
2.39.5 (Apple Git-154)

View File

@ -2,10 +2,13 @@
Name: KubeOS Name: KubeOS
Version: 1.0.8 Version: 1.0.8
Release: 1 Release: 2
Summary: O&M platform used to update the whole OS as an entirety Summary: O&M platform used to update the whole OS as an entirety
License: Mulan PSL v2 License: Mulan PSL v2
Source0: https://gitee.com/openeuler/KubeOS/repository/archive/v%{version}.tar.gz Source0: https://gitee.com/openeuler/KubeOS/repository/archive/v%{version}.tar.gz
Patch1: 0001-fix-kbimg-add-return-statement-for-non-existent-disk.patch
Patch2: 0002-fix-kbimg-incorrect-remove-chroot-script-path.patch
Patch3: 0003-fix-admin-container-correct-path-for-copying-files-i.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: make rust cargo openssl-devel BuildRequires: make rust cargo openssl-devel
@ -70,6 +73,12 @@ install -p -m 0600 ./KubeOS-Rust/kbimg/kbimg.toml %{buildroot}/opt/kubeOS/script
rm -rfv %{buildroot} rm -rfv %{buildroot}
%changelog %changelog
* Wed Dec 11 2024 Yuhang Wei<weiyuhang3@huawei.com> - 1.0.8-2
- Type:requirement
- CVE:NA
- SUG:restart
- DESC:bugs fix of pxe and admin-container
* Tue Dec 10 2024 Yuhang Wei<weiyuhang3@huawei.com> - 1.0.8-1 * Tue Dec 10 2024 Yuhang Wei<weiyuhang3@huawei.com> - 1.0.8-1
- Type:requirement - Type:requirement
- CVE:NA - CVE:NA