mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
fix(getConfig): custom metadata (#3047)
* fix(getConfig): custom metadata when re-using getConfig it is now possible to provide a custom metadata resolver * clean up coding
This commit is contained in:
parent
2d412d9f3c
commit
481f0a1282
@ -240,7 +240,10 @@ func resolveMetadata() (config.StepData, error) {
|
||||
}
|
||||
} else {
|
||||
if configOptions.stepName != "" {
|
||||
metadataMap := GetAllStepMetadata()
|
||||
if GeneralConfig.MetaDataResolver == nil {
|
||||
GeneralConfig.MetaDataResolver = GetAllStepMetadata
|
||||
}
|
||||
metadataMap := GeneralConfig.MetaDataResolver()
|
||||
var ok bool
|
||||
metadata, ok = metadataMap[configOptions.stepName]
|
||||
if !ok {
|
||||
|
@ -41,6 +41,7 @@ type GeneralConfigOptions struct {
|
||||
VaultNamespace string
|
||||
VaultPath string
|
||||
HookConfig HookConfiguration
|
||||
MetaDataResolver func() map[string]config.StepData
|
||||
}
|
||||
|
||||
// HookConfiguration contains the configuration for supported hooks, so far Sentry and Splunk are supported.
|
||||
|
Loading…
Reference in New Issue
Block a user