scripts: fix the scripts load-images.sh and save-images.sh in the case user provides invalid flags
When user provides an invalid flag, print out error message and help menu instead of looping forever Longhorn #1419 Signed-off-by: Phan Le <phan.le@rancher.com>
This commit is contained in:
parent
312ea9d54d
commit
c90ad4cf2b
@ -24,6 +24,11 @@ while [[ $# -gt 0 ]]; do
|
|||||||
help="true"
|
help="true"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
*)
|
||||||
|
echo "Error! invalid flag: ${key}"
|
||||||
|
help="true"
|
||||||
|
break
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -65,4 +70,4 @@ for i in $(cat ${list}); do
|
|||||||
docker push ${reg}longhornio/${i}
|
docker push ${reg}longhornio/${i}
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
@ -19,6 +19,11 @@ while [[ $# -gt 0 ]]; do
|
|||||||
help="true"
|
help="true"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
*)
|
||||||
|
echo "Error! invalid flag: ${key}"
|
||||||
|
help="true"
|
||||||
|
break
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -42,4 +47,4 @@ done
|
|||||||
|
|
||||||
if [[ $images ]]; then
|
if [[ $images ]]; then
|
||||||
docker save $(cat ${list} | tr '\n' ' ') | gzip -c > ${images}
|
docker save $(cat ${list} | tr '\n' ' ') | gzip -c > ${images}
|
||||||
fi
|
fi
|
Loading…
Reference in New Issue
Block a user