Skip to content

Commit a53953d

Browse files
committed
Refactor central SCM URL selection for improved readability, Unify logging of central SCM usage
1 parent d8c1f6b commit a53953d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

scripts/scm-manager/init-scmm.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ function configureScmmManager() {
180180
setPermissionForUser "${METRICS_USERNAME}" "metrics:read"
181181

182182
USE_CENTRAL_SCM=$([[ -n "${CENTRAL_SCM_URL// /}" ]] && echo true || echo false)
183-
echo "CENTRAL_SCM_URL='$CENTRAL_SCM_URL'"
184-
echo "USE_CENTRAL_SCM=$USE_CENTRAL_SCM"
183+
echo "Using central SCM: ${USE_CENTRAL_SCM}, URL: '${CENTRAL_SCM_URL}'"
184+
185185
### ArgoCD Repos
186186
if [[ $INSTALL_ARGOCD == true ]]; then
187187

src/main/groovy/com/cloudogu/gitops/scmm/ScmmRepo.groovy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ class ScmmRepo {
4747
//switching from normal scm path to the central path
4848
this.scmmUrl = "${config.scmm.protocol}://${config.scmm.host}"
4949
if(this.isCentralRepo) {
50-
this.scmmUrl= !config.multiTenant.internal? "${config.multiTenant.centralScmUrl.toString()}" : "http://scmm.${config.multiTenant.centralSCMamespace}.svc.cluster.local/scm"
50+
boolean useInternal = config.multiTenant.internal
51+
String internalUrl = "http://scmm.${config.multiTenant.centralSCMamespace}.svc.cluster.local/scm"
52+
String externalUrl = config.multiTenant.centralScmUrl.toString()
53+
54+
this.scmmUrl = useInternal ? internalUrl : externalUrl
5155
}
5256

5357

0 commit comments

Comments
 (0)