1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

feat: Add debug output to getConfig (#3341)

* Fix Orchestrator detection

* Add unit tests

* Add debug output to getConfig

* Update getConfig.go

* fix whitespaces

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
This commit is contained in:
Marc Bormeth 2021-12-08 10:16:54 +01:00 committed by GitHub
parent b213af1089
commit b760bf48e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -130,6 +130,7 @@ func getConfig() (config.StepConfig, error) {
if GeneralConfig.MetaDataResolver == nil {
GeneralConfig.MetaDataResolver = GetAllStepMetadata
}
log.Entry().Debugf("Trying to resolve metadata for step %s out of all metadata: %v", configOptions.stepName, GeneralConfig.MetaDataResolver())
metadata, err := config.ResolveMetadata(GeneralConfig.GitHubAccessTokens, GeneralConfig.MetaDataResolver, configOptions.stepMetadata, configOptions.stepName)
if err != nil {
return stepConfig, errors.Wrapf(err, "failed to resolve metadata")

View File

@ -501,6 +501,7 @@ func ResolveMetadata(gitHubTokens map[string]string, metaDataResolver func() map
}
} else {
if stepName != "" {
log.Entry().Debugf("Resolving metadata for step: %s", stepName)
if metaDataResolver == nil {
return metadata, errors.New("metaDataResolver is nil")
}