From 190c20cae0d7f38c93ff22aa2d3366f7ee0f8957 Mon Sep 17 00:00:00 2001 From: zhenyus Date: Mon, 23 Jun 2025 16:16:08 +0800 Subject: [PATCH] fix(argo): enhance ciOriginUrl construction in ArgoApplicationVersionUpdater to handle optional port in repository URL Signed-off-by: zhenyus --- .../freeleaps/devops/ArgoApplicationVersionUpdater.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/first-class-pipeline/src/com/freeleaps/devops/ArgoApplicationVersionUpdater.groovy b/first-class-pipeline/src/com/freeleaps/devops/ArgoApplicationVersionUpdater.groovy index 7054ce7c..bfdd1fbc 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/ArgoApplicationVersionUpdater.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/ArgoApplicationVersionUpdater.groovy @@ -55,7 +55,11 @@ class ArgoApplicationVersionUpdater { if (userSpecifiedArgoControlledRepo) { // argoControlledRepo is a git url, so we need add username and password to the url def argoControlledRepoUrlObj = new URL(component.argoControlledRepo) - ciOriginUrl = "${argoControlledRepoUrlObj.protocol}://${steps.env.OPS_GIT_USERNAME}:${steps.env.OPS_GIT_PASSWORD}@${argoControlledRepoUrlObj.host}${argoControlledRepoUrlObj.path}" + if (argoControlledRepoUrlObj.port != null) { + ciOriginUrl = "${argoControlledRepoUrlObj.protocol}://${steps.env.OPS_GIT_USERNAME}:${steps.env.OPS_GIT_PASSWORD}@${argoControlledRepoUrlObj.host}:${argoControlledRepoUrlObj.port}${argoControlledRepoUrlObj.path}" + } else { + ciOriginUrl = "${argoControlledRepoUrlObj.protocol}://${steps.env.OPS_GIT_USERNAME}:${steps.env.OPS_GIT_PASSWORD}@${argoControlledRepoUrlObj.host}${argoControlledRepoUrlObj.path}" + } } steps.sh """ #!/bin/bash