Skip to content

Commit

Permalink
Merge pull request #44 from peng9808/main
Browse files Browse the repository at this point in the history
fix root bug
  • Loading branch information
peng9808 authored Jan 15, 2024
2 parents e14e228 + ee1b14a commit bfa6fbf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions docker-drbd9/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ if [ "$substr" != "deb" ]; then
drbd_rpm=$(find "$RPMDIR" -type f -name "*$OS_KERNEL*" -print -quit)
utils_rpm=$(find "$RPMDIR" -type f -name "drbd-utils*" -print -quit)
if [[ -n "$drbd_rpm" && -n "$utils_rpm" ]]; then
nsenter -t 1 -n -u -i -m -- cp $drbd_rpm /pkgs_root/drbd.rpm
nsenter -t 1 -n -u -i -m -- cp $utils_rpm /pkgs_root/drbd_utils.rpm
nsenter -t 1 -n -u -i -m -- ls /root
nsenter -t 1 -n -u -i -m -- rpm -ivh /pkgs_root/drbd.rpm
nsenter -t 1 -n -u -i -m -- rpm -ivh /pkgs_root/drbd_utils.rpm
cp $drbd_rpm /pkgs_root/drbd.rpm
cp $utils_rpm /pkgs_root/drbd_utils.rpm
nsenter -t 1 -n -u -i -m -- ls /root/
nsenter -t 1 -n -u -i -m -- rpm -ivh /root/drbd.rpm
nsenter -t 1 -n -u -i -m -- rpm -ivh /root/drbd_utils.rpm
exit_code=$?
if [ $exit_code -eq 0 ]; then
nsenter -t 1 -n -u -i -m -- modprobe drbd
Expand All @@ -275,10 +275,10 @@ else
drbd_deb=$(find "$RPMDIR" -type f -name "*$OS_KERNEL*" -print -quit)
utils_deb=$(find "$RPMDIR" -type f -name "drbd-utils*" -print -quit)
if [[ -n "$drbd_rpm" && -n "$utils_rpm" ]]; then
nsenter -t 1 -n -u -i -m -- cp $drbd_deb /pkgs_root/drbd.deb
nsenter -t 1 -n -u -i -m -- cp $utils_deb /pkgs_root/drbd_utils.deb
nsenter -t 1 -n -u -i -m -- apt install -y /pkgs_root/drbd.deb
nsenter -t 1 -n -u -i -m -- apt install -y /pkgs_root/drbd_utils.deb
cp $drbd_deb /pkgs_root/drbd.deb
cp $utils_deb /pkgs_root/drbd_utils.deb
nsenter -t 1 -n -u -i -m -- apt install -y /root/drbd.deb
nsenter -t 1 -n -u -i -m -- apt install -y /root/drbd_utils.deb
exit_code=$?
if [ $exit_code -eq 0 ]; then
nsenter -t 1 -n -u -i -m -- modprobe drbd
Expand Down
6 changes: 3 additions & 3 deletions helm/drbd-adapter/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
volumeMounts:
- name: pkgs
mountPath: /pkgs
- name: pkgs_root
- name: pkgroot
mountPath: /pkgs_root
{{ if ne $distro "unsupported" }}
- name: {{ $distro }}
Expand Down Expand Up @@ -84,7 +84,7 @@ spec:
{{ end }}
- name: pkgs
mountPath: /pkgs
- name: pkgs_root
- name: pkgroot
mountPath: /pkgs_root
- name: os-release
mountPath: /etc/host-release
Expand All @@ -111,7 +111,7 @@ spec:
volumes:
- name: pkgs
emptyDir: {}
- name: pkgs_root
- name: pkgroot
hostPath:
path: /root
- name: os-release
Expand Down

0 comments on commit bfa6fbf

Please sign in to comment.