Revamp plugin loading error management (#85939)

This commit is contained in:
Andres Martinez Gotor
2024-04-11 16:18:04 +02:00
committed by GitHub
parent bb56f4a605
commit ab5a065256
17 changed files with 298 additions and 161 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ func ProvideService() *Service {
}
func (s *Service) Start(ctx context.Context, p *plugins.Plugin) error {
if !p.IsManaged() || !p.Backend || p.SignatureError != nil {
if !p.IsManaged() || !p.Backend || p.Error != nil {
return nil
}
+3 -3
View File
@@ -23,7 +23,7 @@ func TestProcessManager_Start(t *testing.T) {
name string
managed bool
backend bool
signatureError *plugins.SignatureError
Error *plugins.Error
expectedStartCount int
}{
{
@@ -42,7 +42,7 @@ func TestProcessManager_Start(t *testing.T) {
name: "Managed backend plugin with signature error will not be started",
managed: true,
backend: true,
signatureError: &plugins.SignatureError{
Error: &plugins.Error{
SignatureStatus: plugins.SignatureStatusUnsigned,
},
expectedStartCount: 0,
@@ -65,7 +65,7 @@ func TestProcessManager_Start(t *testing.T) {
bp := fakes.NewFakeBackendPlugin(tc.managed)
p := createPlugin(t, bp, func(plugin *plugins.Plugin) {
plugin.Backend = tc.backend
plugin.SignatureError = tc.signatureError
plugin.Error = tc.Error
})
m := ProvideService()