Skip to content

Commit

Permalink
APIGOV-21446 - Fix for setting single entry option on stream if confi…
Browse files Browse the repository at this point in the history
…g url is set (#390)
  • Loading branch information
vivekschauhan authored Apr 12, 2022
1 parent 6920539 commit dfe8a5e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pkg/agent/stream/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,20 @@ func NewStreamer(
TokenGetter: getToken.GetToken,
}
sequenceManager := newAgentSequenceManager(cacheManager, wt.Name)
singleEntryAddr := ""
singleEntryURL, err := url.Parse(cfg.GetSingleURL())
if err == nil {
singleEntryAddr = util.ParseAddr(singleEntryURL)
}

watchOpts := []wm.Option{
wm.WithLogger(logrus.NewEntry(log.Get())),
wm.WithSyncEvents(sequenceManager),
wm.WithTLSConfig(cfg.GetTLSConfig().BuildTLSConfig()),
wm.WithProxy(cfg.GetProxyURL()),
wm.WithSingleEntryAddr(singleEntryAddr),
}

if cfg.GetSingleURL() != "" {
singleEntryURL, err := url.Parse(cfg.GetSingleURL())
if err == nil {
singleEntryAddr := util.ParseAddr(singleEntryURL)
wm.WithSingleEntryAddr(singleEntryAddr)
}
}

return &streamer{
Expand Down

0 comments on commit dfe8a5e

Please sign in to comment.