Skip to content

Commit

Permalink
Give namespace for nerdctl command
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmxs committed Jan 11, 2023
1 parent eb22cb9 commit a7033de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/utils/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ DEV_MAJOR=$(chroot /host nsenter --target 1 --mount lsblk -lp | grep ${DEV} | aw
DEV_MINOR=$(chroot /host nsenter --target 1 --mount lsblk -lp | grep ${DEV} | awk '{print $2}' | awk '{split($0,a,":"); print a[2]}') &&
export LD_LIBRARY_PATH=/opt/discoblocks/lib &&
for CONTAINER_ID in ${CONTAINER_IDS}; do
PID=$(docker inspect -f '{{.State.Pid}}' ${CONTAINER_ID} || nerdctl inspect -f '{{.State.Pid}}' ${CONTAINER_ID} || crictl --runtime-endpoint unix:///run/containerd/containerd.sock inspect --output go-template --template '{{.info.pid}}' ${CONTAINER_ID}) &&
PID=$(docker inspect -f '{{.State.Pid}}' ${CONTAINER_ID} || nerdctl -n k8s.io inspect -f '{{.State.Pid}}' ${CONTAINER_ID} || crictl --runtime-endpoint unix:///run/containerd/containerd.sock inspect --output go-template --template '{{.info.pid}}' ${CONTAINER_ID}) &&
chroot /host nsenter --target ${PID} --mount /opt/discoblocks/busybox mount | grep "${DEV} on ${MOUNT_POINT}" || (
chroot /host nsenter --target ${PID} --mount /opt/discoblocks/busybox mkdir -p $(dirname ${DEV}) ${MOUNT_POINT} &&
(chroot /host nsenter --target ${PID} --pid --mount /opt/discoblocks/busybox mknod ${DEV} b ${DEV_MAJOR} ${DEV_MINOR} ||:) &&
Expand Down

0 comments on commit a7033de

Please sign in to comment.