mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
allow reconfiguration of provider (#4776)
Co-authored-by: Gulom Alimov <gulomjon.alimov@sap.com>
This commit is contained in:
parent
70b860f47f
commit
9074822e57
@ -93,18 +93,22 @@ func GetOrchestratorConfigProvider(opts *Options) (ConfigProvider, error) {
|
||||
provider = newUnknownOrchestratorConfigProvider()
|
||||
err = errors.New("unable to detect a supported orchestrator (Azure DevOps, GitHub Actions, Jenkins)")
|
||||
}
|
||||
|
||||
if opts == nil {
|
||||
log.Entry().Debug("ConfigProvider initialized without options. Some data may be unavailable")
|
||||
return
|
||||
}
|
||||
|
||||
if cfgErr := provider.Configure(opts); cfgErr != nil {
|
||||
err = errors.Wrap(cfgErr, "provider configuration failed")
|
||||
}
|
||||
})
|
||||
if err != nil {
|
||||
return provider, err
|
||||
}
|
||||
|
||||
return provider, err
|
||||
if opts == nil {
|
||||
log.Entry().Debug("ConfigProvider options are not set. Provider configuration is skipped.")
|
||||
return provider, nil
|
||||
}
|
||||
|
||||
// This allows configuration of the provider during initialization and/or after it (reconfiguration)
|
||||
if cfgErr := provider.Configure(opts); cfgErr != nil {
|
||||
return provider, errors.Wrap(cfgErr, "provider configuration failed")
|
||||
}
|
||||
|
||||
return provider, nil
|
||||
}
|
||||
|
||||
// DetectOrchestrator function determines in which orchestrator Piper is running by examining environment variables.
|
||||
|
Loading…
Reference in New Issue
Block a user