Auth: Remove oAuthProviders from Social service (#78732)

* Remove oauthProviders from social svc

* Add EnabledFn to supportbundles.Collector
This commit is contained in:
Misi
2023-11-30 09:30:35 +01:00
committed by GitHub
parent 86311e3a33
commit 79577e4929
5 changed files with 47 additions and 30 deletions
@@ -74,9 +74,15 @@ func (s *Service) bundle(ctx context.Context, collectors []string, uid string) (
files := map[string][]byte{}
for _, collector := range s.bundleRegistry.Collectors() {
if !lookup[collector.UID] && !collector.IncludedByDefault {
collectorEnabled := true
if collector.EnabledFn != nil {
collectorEnabled = collector.EnabledFn()
}
if !(lookup[collector.UID] || collector.IncludedByDefault) || !collectorEnabled {
continue
}
item, err := collector.Fn(ctx)
if err != nil {
s.log.Warn("Failed to collect support bundle item", "error", err, "collector", collector.UID)