Skip to content

Commit 5ee3441

Browse files
committed
add iterate over every host
Signed-off-by: Mario Fernandez <[email protected]>
1 parent a90710d commit 5ee3441

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/manifests/amcfg.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,14 @@ func (f *Factory) ConvertToThanosAlertmanagerConfiguration(ta []AdditionalAlertm
193193

194194
proxyFunc := httpConfig.ProxyFunc()
195195

196-
if len(cfg.StaticConfigs) > 0 && cfg.StaticConfigs[0] != "" {
196+
for _, host := range cfg.StaticConfigs {
197+
if host == "" {
198+
continue
199+
}
200+
197201
u := &url.URL{
198202
Scheme: cfg.Scheme,
199-
Host: cfg.StaticConfigs[0],
203+
Host: host,
200204
}
201205

202206
proxyURL, err := proxyFunc(u)
@@ -206,6 +210,7 @@ func (f *Factory) ConvertToThanosAlertmanagerConfiguration(ta []AdditionalAlertm
206210

207211
if proxyURL != nil {
208212
cfg.ProxyURL = proxyURL.String()
213+
break
209214
}
210215
}
211216

0 commit comments

Comments
 (0)