From: Alexis de Talhouƫt Date: Tue, 6 Feb 2018 13:34:53 +0000 (+0000) Subject: Merge "skip commented lines from values.yaml" X-Git-Tag: 2.0.0-ONAP~469 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=bce13fa0b25fb7932d5ad1be748541682329853c;hp=24d4289ae86401972536b8a5b54124150bfe9a4e;p=oom.git Merge "skip commented lines from values.yaml" --- diff --git a/kubernetes/config/prepull_docker.sh b/kubernetes/config/prepull_docker.sh index e456c3e016..ef46334197 100755 --- a/kubernetes/config/prepull_docker.sh +++ b/kubernetes/config/prepull_docker.sh @@ -101,33 +101,32 @@ do #parse yaml files for line in `parse_yaml $filename` do - #find all image subtag inside converted values.yaml file's lines - if echo $line | grep -q $IMAGE_TEXT ; then - #find imageName inside line - imageName=`echo $line | awk -F "=" '{print $2}'` - #remove attional prefix and postfix - imageNameFinal=`echo "$imageName" | sed -e 's/^"//' -e 's/"$//' ` - - #check if line contain Version as a subtag in lines if yes then call docker pull with version - if echo $line | grep -q $IMAGE_VERSION_TEXT ; then - echo docker pull "$imageNameWithVersion":"$imageNameFinal" - docker pull $imageNameWithVersion:$imageNameFinal & - imageNameWithVersion=" " - else - #check Version is not in subtag and old scanned value is present then call docker pull without version - if [ "$imageNameWithVersion" != " " ]; then - echo docker pull "$imageNameWithVersion" - docker pull $imageNameWithVersion & - imageNameWithVersion=$imageNameFinal + #skiping commented line + if [[ ${line:0:1} != '#' ]]; then + #find all image subtag inside converted values.yaml file's lines + if echo $line | grep -q $IMAGE_TEXT ; then + #find imageName inside line + imageName=`echo $line | awk -F "=" '{print $2}'` + #remove attional prefix and postfix + imageNameFinal=`echo "$imageName" | sed -e 's/^"//' -e 's/"$//' ` + + #check if line contain Version as a subtag in lines if yes then call docker pull with version + if echo $line | grep -q $IMAGE_VERSION_TEXT ; then + echo docker pull "$imageNameWithVersion":"$imageNameFinal" + docker pull $imageNameWithVersion:$imageNameFinal & + imageNameWithVersion=" " else - imageNameWithVersion=$imageNameFinal + #check Version is not in subtag and old scanned value is present then call docker pull without version + if [ "$imageNameWithVersion" != " " ]; then + echo docker pull "$imageNameWithVersion" + docker pull $imageNameWithVersion & + imageNameWithVersion=$imageNameFinal + else + imageNameWithVersion=$imageNameFinal + fi fi fi - - fi - - done done # complete processing