fix(argo): declare ciOriginUrl as a local variable in ArgoApplicationVersionUpdater for improved scope management

Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
zhenyus 2025-06-23 16:09:19 +08:00
parent eba3129f39
commit decc7e90f9

View File

@ -51,7 +51,7 @@ class ArgoApplicationVersionUpdater {
steps.writeYaml(file: valuesFile, data: data, overwrite: true)
steps.withCredentials([steps.usernamePassword(credentialsId: repoCredentialsId, passwordVariable: 'OPS_GIT_PASSWORD', usernameVariable: 'OPS_GIT_USERNAME')]) {
ciOriginUrl = "https://${steps.env.OPS_GIT_USERNAME}:${steps.env.OPS_GIT_PASSWORD}@gitea.freeleaps.mathmast.com/freeleaps/freeleaps-ops.git"
def ciOriginUrl = "https://${steps.env.OPS_GIT_USERNAME}:${steps.env.OPS_GIT_PASSWORD}@gitea.freeleaps.mathmast.com/freeleaps/freeleaps-ops.git"
if (userSpecifiedArgoControlledRepo) {
// argoControlledRepo is a git url, so we need add username and password to the url
def argoControlledRepoUrlObj = new URL(component.argoControlledRepo)