From c3071ccc300dec664b774e60063bc94fd90e006e Mon Sep 17 00:00:00 2001 From: mayankg2703 Date: Wed, 22 Nov 2017 11:34:59 +0000 Subject: Dynamic preload docker images script Issue-ID: OOM-328 Change-Id: I7a646f53df0ac11cf3c1895243f905b7fe210b3c Signed-off-by: mayankg2703 --- kubernetes/config/prepull_docker.sh | 145 ++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100755 kubernetes/config/prepull_docker.sh diff --git a/kubernetes/config/prepull_docker.sh b/kubernetes/config/prepull_docker.sh new file mode 100755 index 0000000000..e456c3e016 --- /dev/null +++ b/kubernetes/config/prepull_docker.sh @@ -0,0 +1,145 @@ +#!/bin/bash + +#function to provide help +#desc: this function provide help menu +#argument: -h for help, -p for path, -r for repository +#calling syntax: options + +options() { + cat < + +function parse_yaml { + local prefix=$2 + local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') + sed -ne "s|^\($s\):|\1|" \ + -e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \ + -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | + awk -F$fs '{ + indent = length($1)/2; + vname[indent] = $2; + for (i in vname) {if (i > indent) {delete vname[i]}} + if (length($3) > 0) { + vn=""; for (i=0; i