Skip to content

Commit f16b8ba

Browse files
valituguranBraisVQ
authored andcommitted
Edpc 3516 verify cluster configuration (#1228)
Fix credentials id retrieval.
1 parent 535e033 commit f16b8ba

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
### Changed
99

1010
### Fixed
11+
* Fix credentials id retrieval ([#1228](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1228))
1112
* Fix Tailor deployment drifts for D, Q envs ([#1055](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1055))
1213

1314
## [4.9.0] - 2025-8-06

src/org/ods/orchestration/DeployStage.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,14 @@ class DeployStage extends Stage {
9090
"'${project.buildParams.targetEnvironment}' installable repos? ${installableRepos?.size()}")
9191

9292
if (installableRepos?.size() > 0) {
93+
String openshiftClusterCredentialsId = project.environmentConfig?.credentialsId
94+
?: project.environmentConfig?.openshiftClusterCredentialsId
9395
util.verifyEnvLoginAndExistence(script,
9496
os,
9597
project.targetProject,
9698
project.data.openshift?.sessionApiUrl,
9799
project.data.openshift?.targetApiUrl,
98-
project.environmentConfig?.credentialsId)
100+
openshiftClusterCredentialsId)
99101
}
100102
}
101103

test/groovy/org/ods/orchestration/DeployStageSpec.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class DeployStageSpec extends SpecHelper {
141141
1 * bitbucketService.getUrl() >> "https://bitbucket"
142142
1 * util.getInstallableRepos()
143143
1 * util.verifyEnvLoginAndExistence(*_)
144-
0 * script.usernamePassword(['credentialsId':'testCredentials',
144+
0 * script.usernamePassword(['credentialsId':'',
145145
'usernameVariable':'EXTERNAL_OCP_API_SA',
146146
'passwordVariable':'EXTERNAL_OCP_API_TOKEN'])
147147
}
@@ -169,8 +169,8 @@ class DeployStageSpec extends SpecHelper {
169169
openshiftService.envExists(project.targetProject) >> true
170170
util.prepareExecutePhaseForReposNamedJob(*_) >> []
171171
project.data.metadata.environments.prod = [
172-
'apiUrl': 'external.api.com',
173-
'credentialsId': 'testCredentials'
172+
'openshiftClusterApiUrl': 'external.api.com',
173+
'openshiftClusterCredentialsId': 'testCredentials'
174174
]
175175
project.setOpenShiftData("test.api.url")
176176

0 commit comments

Comments
 (0)