feat: merge default proxy groups of all subscription
This commit is contained in:
@ -350,6 +350,7 @@ func (m *Manager) resolveSubscriptions() []*model.Subscription {
|
||||
func (m *Manager) mergeSubscriptions(subs []*model.Subscription) (map[string]interface{}, []automation.ProxyRef, bool) {
|
||||
combined := map[string]interface{}{}
|
||||
var proxies []automation.ProxyRef
|
||||
var selectionGroups []map[string]interface{}
|
||||
|
||||
for _, sub := range subs {
|
||||
filePath := sub.GetFilePath(m.Storage.ConfigDir)
|
||||
@ -374,10 +375,14 @@ func (m *Manager) mergeSubscriptions(subs []*model.Subscription) (map[string]int
|
||||
}
|
||||
|
||||
proxies = append(proxies, automation.PrefixProxyNames(sub.Name, data)...)
|
||||
if group := popFirstProxyGroup(data); group != nil {
|
||||
selectionGroups = append(selectionGroups, group)
|
||||
}
|
||||
combined = deepMerge(combined, data)
|
||||
}
|
||||
|
||||
combined["rules"] = dedupeMatchRule(combined["rules"])
|
||||
mergeProxySelection(combined, selectionGroups)
|
||||
|
||||
return combined, proxies, true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user