From f16b8bae83702f0337cd61f8934b4117ca954eeb Mon Sep 17 00:00:00 2001 From: Vali Tuguran Date: Fri, 8 Aug 2025 15:04:54 +0300 Subject: [PATCH 1/2] Edpc 3516 verify cluster configuration (#1228) Fix credentials id retrieval. --- CHANGELOG.md | 1 + src/org/ods/orchestration/DeployStage.groovy | 4 +++- test/groovy/org/ods/orchestration/DeployStageSpec.groovy | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f8132b87..99699e062 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Changed ### Fixed +* Fix credentials id retrieval ([#1228](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1228)) * Fix Tailor deployment drifts for D, Q envs ([#1055](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1055)) ## [4.9.0] - 2025-8-06 diff --git a/src/org/ods/orchestration/DeployStage.groovy b/src/org/ods/orchestration/DeployStage.groovy index 98139a500..a1577b7fd 100644 --- a/src/org/ods/orchestration/DeployStage.groovy +++ b/src/org/ods/orchestration/DeployStage.groovy @@ -90,12 +90,14 @@ class DeployStage extends Stage { "'${project.buildParams.targetEnvironment}' installable repos? ${installableRepos?.size()}") if (installableRepos?.size() > 0) { + String openshiftClusterCredentialsId = project.environmentConfig?.credentialsId + ?: project.environmentConfig?.openshiftClusterCredentialsId util.verifyEnvLoginAndExistence(script, os, project.targetProject, project.data.openshift?.sessionApiUrl, project.data.openshift?.targetApiUrl, - project.environmentConfig?.credentialsId) + openshiftClusterCredentialsId) } } diff --git a/test/groovy/org/ods/orchestration/DeployStageSpec.groovy b/test/groovy/org/ods/orchestration/DeployStageSpec.groovy index afcb2a147..6adbd6604 100644 --- a/test/groovy/org/ods/orchestration/DeployStageSpec.groovy +++ b/test/groovy/org/ods/orchestration/DeployStageSpec.groovy @@ -141,7 +141,7 @@ class DeployStageSpec extends SpecHelper { 1 * bitbucketService.getUrl() >> "https://bitbucket" 1 * util.getInstallableRepos() 1 * util.verifyEnvLoginAndExistence(*_) - 0 * script.usernamePassword(['credentialsId':'testCredentials', + 0 * script.usernamePassword(['credentialsId':'', 'usernameVariable':'EXTERNAL_OCP_API_SA', 'passwordVariable':'EXTERNAL_OCP_API_TOKEN']) } @@ -169,8 +169,8 @@ class DeployStageSpec extends SpecHelper { openshiftService.envExists(project.targetProject) >> true util.prepareExecutePhaseForReposNamedJob(*_) >> [] project.data.metadata.environments.prod = [ - 'apiUrl': 'external.api.com', - 'credentialsId': 'testCredentials' + 'openshiftClusterApiUrl': 'external.api.com', + 'openshiftClusterCredentialsId': 'testCredentials' ] project.setOpenShiftData("test.api.url") From d6bb19c6d303c6879ace6e6bcd3a81bf8897713b Mon Sep 17 00:00:00 2001 From: brais <26645694+BraisVQ@users.noreply.github.com> Date: Mon, 11 Aug 2025 09:35:28 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99699e062..cd51e6d53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,13 @@ ### Changed ### Fixed -* Fix credentials id retrieval ([#1228](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1228)) * Fix Tailor deployment drifts for D, Q envs ([#1055](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1055)) +## [4.9.1] - 2025-8-11 +### Fixed +* Fix credentials id retrieval ([#1228](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1228)) + + ## [4.9.0] - 2025-8-06 ### Changed * Enforce prod config in metadata.yml ([#1222](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1222))