You've already forked sap-jenkins-library
							
							
				mirror of
				https://github.com/SAP/jenkins-library.git
				synced 2025-10-30 23:57:50 +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:
		| @@ -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. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user