Plugins: Ensure service registration occurs in right order (#74001)

* make sure service registration occurs in right order

* fix test
This commit is contained in:
Will Browne
2023-08-29 14:55:08 +02:00
committed by GitHub
parent 9e1eab3d70
commit 557b1654f9
5 changed files with 208 additions and 6 deletions
+23
View File
@@ -583,3 +583,26 @@ func (p *FakeBackendPlugin) Kill() {
defer p.mutex.Unlock()
p.Running = false
}
type FakeFeatureToggles struct {
features map[string]bool
}
func NewFakeFeatureToggles(features ...string) *FakeFeatureToggles {
m := make(map[string]bool)
for _, f := range features {
m[f] = true
}
return &FakeFeatureToggles{
features: m,
}
}
func (f *FakeFeatureToggles) GetEnabled(_ context.Context) map[string]bool {
return f.features
}
func (f *FakeFeatureToggles) IsEnabled(feature string) bool {
return f.features[feature]
}