diff --git a/controllers/static/nodepool/generate-config.sh b/controllers/static/nodepool/generate-config.sh index ed7aac1e..24a64434 100644 --- a/controllers/static/nodepool/generate-config.sh +++ b/controllers/static/nodepool/generate-config.sh @@ -31,8 +31,8 @@ if [ "$CONFIG_REPO_SET" == "TRUE" ]; then REF=${REF:-origin/master} # Clone or fetch config repository - if [ -d ~/${CONFIG_REPO_NAME}/.git ]; then - pushd ~/${CONFIG_REPO_NAME} + if [ -d ~/config/.git ]; then + pushd ~/config git remote remove origin git remote add origin ${CONFIG_REPO_BASE_URL}/${CONFIG_REPO_NAME} git fetch origin @@ -40,13 +40,13 @@ if [ "$CONFIG_REPO_SET" == "TRUE" ]; then popd else pushd ~/ - git clone ${CONFIG_REPO_BASE_URL}/${CONFIG_REPO_NAME} + git clone ${CONFIG_REPO_BASE_URL}/${CONFIG_REPO_NAME} config popd fi # Append the config repo provided config file to the default one - if [ -f ~/${CONFIG_REPO_NAME}/nodepool/${NODEPOOL_CONFIG_FILE} ]; then - cat ~/${CONFIG_REPO_NAME}/nodepool/${NODEPOOL_CONFIG_FILE} >> ~/nodepool.yaml + if [ -f ~/config/nodepool/${NODEPOOL_CONFIG_FILE} ]; then + cat ~/config/nodepool/${NODEPOOL_CONFIG_FILE} >> ~/nodepool.yaml fi fi diff --git a/controllers/static/zuul/generate-tenant-config.sh b/controllers/static/zuul/generate-tenant-config.sh index 40689a81..af690dc6 100644 --- a/controllers/static/zuul/generate-tenant-config.sh +++ b/controllers/static/zuul/generate-tenant-config.sh @@ -26,8 +26,8 @@ if [ "$CONFIG_REPO_SET" == "TRUE" ]; then REF=${REF:-origin/master} # Clone or fetch config repository - if [ -d ~/${CONFIG_REPO_NAME}/.git ]; then - pushd ~/${CONFIG_REPO_NAME} + if [ -d ~/config/.git ]; then + pushd ~/config git remote | grep origin && git remote remove origin git remote add origin ${CONFIG_REPO_BASE_URL}/${CONFIG_REPO_NAME} if [ "$INIT_CONTAINER" == "1" ]; then @@ -41,9 +41,9 @@ if [ "$CONFIG_REPO_SET" == "TRUE" ]; then else pushd ~/ if [ "$INIT_CONTAINER" == "1" ]; then - git clone ${CONFIG_REPO_BASE_URL}/${CONFIG_REPO_NAME} || true + git clone ${CONFIG_REPO_BASE_URL}/${CONFIG_REPO_NAME} config || true else - git clone ${CONFIG_REPO_BASE_URL}/${CONFIG_REPO_NAME} + git clone ${CONFIG_REPO_BASE_URL}/${CONFIG_REPO_NAME} config fi popd fi @@ -56,8 +56,8 @@ if [ "$CONFIG_REPO_SET" == "TRUE" ]; then EOF # Append the config repo provided tenant file to the default one - if [ -f ~/${CONFIG_REPO_NAME}/zuul/main.yaml ]; then - cat ~/${CONFIG_REPO_NAME}/zuul/main.yaml >> ~/main.yaml + if [ -f ~/config/zuul/main.yaml ]; then + cat ~/config/zuul/main.yaml >> ~/main.yaml fi fi