apiVersion: v1
data:
  init.bash: |
    until wget -q --spider http://configservice/manage/health;
    do 
      echo 'waiting for configservice'; 
      sleep 11; 
    done;
    
    echo 'test if config exists'
    getuseryml=$(curl -s -o /dev/null -w "%{http_code}" http://configservice/api/resources/application-userservice.yml)
    
    if [ $getuseryml != 200 ]
    then
      echo 'userservice yml not found'
      exit 1
    else
      echo 'userservice yml exists'
    fi
    
kind: ConfigMap
metadata:
  name: inituserserviceconfigmap
