mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Fix shellcheck failures in bootstrap.sh and create_block.sh
This commit is contained in:
		@@ -107,8 +107,6 @@
 | 
				
			|||||||
./test/images/volume/gluster/run_gluster.sh
 | 
					./test/images/volume/gluster/run_gluster.sh
 | 
				
			||||||
./test/images/volume/iscsi/create_block.sh
 | 
					./test/images/volume/iscsi/create_block.sh
 | 
				
			||||||
./test/images/volume/nfs/run_nfs.sh
 | 
					./test/images/volume/nfs/run_nfs.sh
 | 
				
			||||||
./test/images/volume/rbd/bootstrap.sh
 | 
					 | 
				
			||||||
./test/images/volume/rbd/create_block.sh
 | 
					 | 
				
			||||||
./third_party/forked/shell2junit/sh2ju.sh
 | 
					./third_party/forked/shell2junit/sh2ju.sh
 | 
				
			||||||
./third_party/intemp/intemp.sh
 | 
					./third_party/intemp/intemp.sh
 | 
				
			||||||
./third_party/multiarch/qemu-user-static/register/qemu-binfmt-conf.sh
 | 
					./third_party/multiarch/qemu-user-static/register/qemu-binfmt-conf.sh
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,10 +25,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Create /etc/ceph/ceph.conf
 | 
					# Create /etc/ceph/ceph.conf
 | 
				
			||||||
sh ./ceph.conf.sh `hostname -i`
 | 
					sh ./ceph.conf.sh "$(hostname -i)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Configure and start ceph-mon
 | 
					# Configure and start ceph-mon
 | 
				
			||||||
sh ./mon.sh `hostname -i`
 | 
					sh ./mon.sh "$(hostname -i)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Configure and start 2x ceph-osd
 | 
					# Configure and start 2x ceph-osd
 | 
				
			||||||
mkdir -p /var/lib/ceph/osd/ceph-0 /var/lib/ceph/osd/ceph-1
 | 
					mkdir -p /var/lib/ceph/osd/ceph-0 /var/lib/ceph/osd/ceph-1
 | 
				
			||||||
@@ -51,7 +51,7 @@ ceph fs new cephfs cephfs_metadata cephfs_data
 | 
				
			|||||||
# It takes a while until the volume created above is mountable,
 | 
					# It takes a while until the volume created above is mountable,
 | 
				
			||||||
# 1 second is usually enough, but try indefinetily.
 | 
					# 1 second is usually enough, but try indefinetily.
 | 
				
			||||||
sleep 1
 | 
					sleep 1
 | 
				
			||||||
while ! ceph-fuse -m `hostname -i`:6789 /mnt; do
 | 
					while ! ceph-fuse -m "$(hostname -i):6789" /mnt; do
 | 
				
			||||||
    echo "Waiting for cephfs to be up"
 | 
					    echo "Waiting for cephfs to be up"
 | 
				
			||||||
    sleep 1
 | 
					    sleep 1
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,7 +20,7 @@
 | 
				
			|||||||
# Exit on the first error.
 | 
					# Exit on the first error.
 | 
				
			||||||
set -e
 | 
					set -e
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MNTDIR=`mktemp -d`
 | 
					MNTDIR="$(mktemp -d)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cleanup()
 | 
					cleanup()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -28,8 +28,8 @@ cleanup()
 | 
				
			|||||||
    RET=$?
 | 
					    RET=$?
 | 
				
			||||||
    # Silently remove everything and ignore errors
 | 
					    # Silently remove everything and ignore errors
 | 
				
			||||||
    set +e
 | 
					    set +e
 | 
				
			||||||
    /bin/umount $MNTDIR 2>/dev/null
 | 
					    /bin/umount "$MNTDIR" 2>/dev/null
 | 
				
			||||||
    /bin/rmdir $MNTDIR 2>/dev/null
 | 
					    /bin/rmdir "$MNTDIR" 2>/dev/null
 | 
				
			||||||
    /bin/rm block 2>/dev/null
 | 
					    /bin/rm block 2>/dev/null
 | 
				
			||||||
    exit $RET
 | 
					    exit $RET
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -42,9 +42,9 @@ dd if=/dev/zero of=block seek=120 count=1 bs=1M
 | 
				
			|||||||
mkfs.ext2 block
 | 
					mkfs.ext2 block
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Add index.html to it
 | 
					# Add index.html to it
 | 
				
			||||||
mount -o loop block $MNTDIR
 | 
					mount -o loop block "$MNTDIR"
 | 
				
			||||||
echo "Hello from RBD" > $MNTDIR/index.html
 | 
					echo "Hello from RBD" > "$MNTDIR/index.html"
 | 
				
			||||||
umount $MNTDIR
 | 
					umount "$MNTDIR"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
rm block.tar.gz 2>/dev/null || :
 | 
					rm block.tar.gz 2>/dev/null || :
 | 
				
			||||||
tar cfz block.tar.gz block
 | 
					tar cfz block.tar.gz block
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user