From 0a9bbd3f613a768fe9e14904ad999296631be65f Mon Sep 17 00:00:00 2001 From: Mirko Teodorovic Date: Wed, 9 Feb 2022 19:30:28 +0100 Subject: [PATCH] setting default routes mqtt channel to send (#50) Signed-off-by: mteodor --- pkg/bootstrap/bootstrap.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/bootstrap/bootstrap.go b/pkg/bootstrap/bootstrap.go index d4465c94..414a3381 100644 --- a/pkg/bootstrap/bootstrap.go +++ b/pkg/bootstrap/bootstrap.go @@ -157,9 +157,9 @@ func fillExportConfig(econf export.Config, c agent.Config) export.Config { if econf.MQTT.ClientPrivKeyPath == "" { econf.MQTT.ClientPrivKeyPath = c.MQTT.PrivKeyPath } - for _, route := range econf.Routes { + for i, route := range econf.Routes { if route.MqttTopic == "" { - route.MqttTopic = "channels/" + c.Channels.Data + "/messages" + econf.Routes[i].MqttTopic = "channels/" + c.Channels.Data + "/messages" } } return econf