Fix config update when config is "null"

When the tunnel reads the config from the server and it is "null" then
ignore it.

Fixes #1029
This commit is contained in:
Christian Köberl 2023-07-20 21:42:49 +00:00
parent b500e556bf
commit 071e4be6a3
1 changed files with 9 additions and 0 deletions

View File

@ -74,6 +74,15 @@ func (o *Orchestrator) UpdateConfig(version int32, config []byte) *tunnelpogs.Up
LastAppliedVersion: o.currentVersion,
}
}
if string(config) == "null" {
o.log.Info().Msg("Ignore null config from server")
o.currentVersion = version
return &tunnelpogs.UpdateConfigurationResponse{
LastAppliedVersion: o.currentVersion,
}
}
var newConf newRemoteConfig
if err := json.Unmarshal(config, &newConf); err != nil {
o.log.Err(err).