Skip to content

Commit

Permalink
Merge pull request #42 from peng9808/main
Browse files Browse the repository at this point in the history
fix dependencies
  • Loading branch information
peng9808 authored Jan 15, 2024
2 parents 7656753 + 926a9dd commit 458c2e4
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release-shipper-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [ "main" ]
paths:
- 'docker-shipper/*'
- 'docker-shipper/*/*'
- "helm/drbd-adapter/Chart.yaml"
- '.github/workflow/release-shipper-images.yml'

Expand Down
40 changes: 31 additions & 9 deletions docker-drbd9/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SIGN_KEY=https://packages.linbit.com/package-signing-pubkey.asc
PKGS=/pkgs
HOSTRELEASE=/etc/host-release
RPMDIR=/pkgs/drbd-rpms/
DEBDIR=/pkgs/drbd-debs/

die() {
>&2 echo
Expand Down Expand Up @@ -237,23 +238,22 @@ if grep -q '^drbd ' /proc/modules; then
exit 0
fi

result=$(lbdisttool.py --os-release $HOSTRELEASE -l || echo "")
substr="${result:0:3}"
if [ "$substr" != "deb" ]; then
if [ -z "$OS_KERNEL" ]; then
if [ -z "$OS_KERNEL" ]; then
debug "The system parameters are obtained successfully (OS_KERNEL)"
exit 1
fi
ls "$RPMDIR"
result=$(lbdisttool.py --os-release $HOSTRELEASE -l || echo "")
substr="${result:0:3}"
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
rpm -ivh "$utils_rpm"
rpm -ivh "$drbd_rpm"
nsenter -t 1 -n -u -i -m --rpm -ivh "$utils_rpm"
nsenter -t 1 -n -u -i -m --rpm -ivh "$drbd_rpm"
exit_code=$?
if [ $exit_code -eq 0 ]; then
modprobe drbd
modprobe drbd_transport_tcp
nsenter -t 1 -n -u -i -m --modprobe drbd
nsenter -t 1 -n -u -i -m --modprobe drbd_transport_tcp
exit_code=$?
if [ $exit_code -eq 0 ]; then
#Notify shipper that installation is complete
Expand All @@ -268,6 +268,28 @@ if [ "$substr" != "deb" ]; then
fi
else debug "There is no corresponding kernel version rpm package or drbd-utils rpm package"
fi
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 --apt install -y drbd_deb
nsenter -t 1 -n -u -i -m --apt install -y utils_deb
exit_code=$?
if [ $exit_code -eq 0 ]; then
nsenter -t 1 -n -u -i -m --modprobe drbd
nsenter -t 1 -n -u -i -m --modprobe drbd_transport_tcp
exit_code=$?
if [ $exit_code -eq 0 ]; then
export DRBD_RMP_INSTALL='yes'
exit 0
else
debug "modprobe err_code: $exit_code"
fi
else
debug "apt install err_code: $exit_code"
fi
else debug "There is no corresponding kernel version deb package or drbd-utils deb package"
fi
fi


Expand Down
2 changes: 1 addition & 1 deletion helm/drbd-adapter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ affinity:

# only apply to "deployKind: job"
# by default NOT deploying on masters (yes|no)
deployOnMasters: "no"
deployOnMasters: "yes"
# by default NOT using Affinity (yes|no)
useAffinity: "no"

0 comments on commit 458c2e4

Please sign in to comment.