Plugins: Remove unnecessary error result from env vars interface (#73224)
* remove error from interface * fix test
This commit is contained in:
1 parent
16d24a8429
commit
c830c01e61
4 files changed
+11
-21
No files matched your search
@@ -46,11 +46,7 @@ func (b *BackendClientInit) Initialize(ctx context.Context, p *plugins.Plugin) (
|
||||
return nil, errors.New("could not find backend factory for plugin")
|
||||
}
|
||||
|
||||
env, err := b.envVarProvider.Get(ctx, p)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if backendClient, err := backendFactory(p.ID, p.Logger(), env); err != nil {
|
||||
if backendClient, err := backendFactory(p.ID, p.Logger(), b.envVarProvider.Get(ctx, p)); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
p.RegisterClient(backendClient)
|
||||
|
||||
@@ -124,9 +124,9 @@ type fakeEnvVarsProvider struct {
|
||||
GetFunc func(ctx context.Context, p *plugins.Plugin) []string
|
||||
}
|
||||
|
||||
func (f *fakeEnvVarsProvider) Get(ctx context.Context, p *plugins.Plugin) ([]string, error) {
|
||||
func (f *fakeEnvVarsProvider) Get(ctx context.Context, p *plugins.Plugin) []string {
|
||||
if f.GetFunc != nil {
|
||||
return f.GetFunc(ctx, p), nil
|
||||
return f.GetFunc(ctx, p)
|
||||
}
|
||||
return nil, nil
|
||||
return nil
|
||||
}
|
||||
Reference in new issue
Block a user