Skip to content

Commit f078e66

Browse files
authored
Merge pull request #207 from cloudogu/feature/fix-endless-loop-remote
Fix startup error with --remote Tested with current MN CES Setup.
2 parents 5355320 + 6e477eb commit f078e66

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

scripts/scm-manager/init-scmm.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ function initSCMM() {
2323
SCMM_HOST=$(getHost "${SCMM_URL}")
2424
SCMM_PROTOCOL=$(getProtocol "${SCMM_URL}")
2525

26-
setExternalHostnameIfNecessary 'SCMM' 'scmm-scm-manager' 'default'
26+
if [[ ${INTERNAL_SCMM} == true ]]; then
27+
setExternalHostnameIfNecessary 'SCMM' 'scmm-scm-manager' 'default'
28+
fi
29+
2730
[[ "${SCMM_URL}" != *scm ]] && SCMM_URL=${SCMM_URL}/scm
2831

2932
configureScmmManager "${SCMM_USERNAME}" "${SCMM_PASSWORD}" "${SCMM_URL}" "${JENKINS_URL_FOR_SCMM}" \

scripts/utils.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,10 @@ function setExternalHostnameIfNecessary() {
5555
local serviceName="$2"
5656
local namespace="$3"
5757

58-
# :-} expands to empty string, e.g. for INTERNAL_ARGO which does not exist.
59-
# This only works when checking for != false 😬
60-
if [[ $REMOTE_CLUSTER == true && "$(eval echo "\${INTERNAL_${variablePrefix}:-}")" != 'false' ]]; then
61-
# Update SCMM_URL or JENKINS_URL or ARGOCD_URL
58+
if [[ $REMOTE_CLUSTER == true ]]; then
59+
# Update SCMM_URL or JENKINS_URL
6260
# Only if apps are not external
6361
# Our apps are configured to use port 80 on remote clusters
64-
# Argo forwards to HTTPS so simply use HTTP here
6562
declare -g "${variablePrefix}_URL"="http://$(getExternalIP "${serviceName}" "${namespace}")"
6663
fi
6764
}

src/main/groovy/com/cloudogu/gitops/features/ScmManager.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class ScmManager extends Feature {
7777
SCMM_USERNAME : config.scmm['username'],
7878
SCMM_PASSWORD : config.scmm['password'],
7979
JENKINS_URL : config.jenkins['url'],
80+
INTERNAL_SCMM : config.scmm['internal'],
8081
JENKINS_URL_FOR_SCMM : config.jenkins['urlForScmm'],
8182
SCMM_URL_FOR_JENKINS : config.scmm['urlForJenkins'],
8283
// Used indirectly in utils.sh 😬

0 commit comments

Comments
 (0)