mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-26 22:39:07 +01:00
fix combined server config around sync message versioning
Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
This commit is contained in:
@@ -74,6 +74,9 @@ type ServerConfig struct {
|
|||||||
ActivityStore StoreConfig `yaml:"activityStore"`
|
ActivityStore StoreConfig `yaml:"activityStore"`
|
||||||
AuthStore StoreConfig `yaml:"authStore"`
|
AuthStore StoreConfig `yaml:"authStore"`
|
||||||
ReverseProxy ReverseProxyConfig `yaml:"reverseProxy"`
|
ReverseProxy ReverseProxyConfig `yaml:"reverseProxy"`
|
||||||
|
|
||||||
|
SupportedSyncMessageVersions []string `yaml:"supportedSyncMessageVersions"`
|
||||||
|
PerAccountSupportedSyncMessageVersions map[string][]string `yaml:"perAccountSupportedSyncMessageVersions"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TLSConfig contains TLS/HTTPS settings
|
// TLSConfig contains TLS/HTTPS settings
|
||||||
@@ -129,8 +132,6 @@ type ManagementConfig struct {
|
|||||||
SignalURI string `yaml:"signalUri"`
|
SignalURI string `yaml:"signalUri"`
|
||||||
Store StoreConfig `yaml:"store"`
|
Store StoreConfig `yaml:"store"`
|
||||||
ReverseProxy ReverseProxyConfig `yaml:"reverseProxy"`
|
ReverseProxy ReverseProxyConfig `yaml:"reverseProxy"`
|
||||||
SupportedSyncMessageVersions []string `yaml:"supportedSyncMessageVersions"`
|
|
||||||
PerAccountSupportedSyncMessageVersions map[string][]string `yaml:"perAccountSupportedSyncMessageVersions"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AuthConfig contains authentication/identity provider settings
|
// AuthConfig contains authentication/identity provider settings
|
||||||
@@ -706,6 +707,8 @@ func (c *CombinedConfig) ToManagementConfig() (*nbconfig.Config, error) {
|
|||||||
ReverseProxy: reverseProxy,
|
ReverseProxy: reverseProxy,
|
||||||
DisableDefaultPolicy: mgmt.DisableDefaultPolicy,
|
DisableDefaultPolicy: mgmt.DisableDefaultPolicy,
|
||||||
EmbeddedIdP: embeddedIdP,
|
EmbeddedIdP: embeddedIdP,
|
||||||
|
SupportedSyncMessageVersions: c.Server.SupportedSyncMessageVersions,
|
||||||
|
PerAccountSupportedSyncMessageVersions: c.Server.PerAccountSupportedSyncMessageVersions,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -506,11 +506,11 @@ func createManagementServer(cfg *CombinedConfig, mgmtConfig *nbconfig.Config) (m
|
|||||||
}
|
}
|
||||||
mgmtPort, _ := strconv.Atoi(portStr)
|
mgmtPort, _ := strconv.Atoi(portStr)
|
||||||
|
|
||||||
if err := syncgrpc.ValidateSyncMessageVersions(cfg.Management.SupportedSyncMessageVersions); err != nil {
|
if err := syncgrpc.ValidateSyncMessageVersions(mgmtConfig.SupportedSyncMessageVersions); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
for accountId, versions := range cfg.Management.PerAccountSupportedSyncMessageVersions {
|
for accountId, versions := range mgmtConfig.PerAccountSupportedSyncMessageVersions {
|
||||||
if err := syncgrpc.ValidateSyncMessageVersions(versions); err != nil {
|
if err := syncgrpc.ValidateSyncMessageVersions(versions); err != nil {
|
||||||
return nil, fmt.Errorf("unrecognized sync message version in perAccountSupportedSyncMessageVersions for account %s %w", accountId, err)
|
return nil, fmt.Errorf("unrecognized sync message version in perAccountSupportedSyncMessageVersions for account %s %w", accountId, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user