Skip to content

Commit

Permalink
fixes configmap based tcp sync
Browse files Browse the repository at this point in the history
This update ensures that configmap based TCP services are applied in the
very first controller reconciliation. Cur config is only defined from
the second reconciliation, so the TCP service would be empty if the
controller bootstrap doesn't call the reconciliation at least twice.
  • Loading branch information
jcmoraisjr committed May 28, 2023
1 parent 057bfa2 commit 6796c83
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/converters/converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ func (c *converters) Sync() {
//
// configmap converters
//
if changed.TCPConfigMapDataCur != nil {
if changed.TCPConfigMapDataCur != nil || changed.TCPConfigMapDataNew != nil {
// We always need to run configmap based tcp sync, when configured,
// because we don't have any tracking in place asking us to do it.
// Although cur is always assigned if configmap based tcp is configured,
// only new is assigned in the very first run. Otoh new is only assigned
// when the configmap is changed. So we need to check both.
tcpSvcConverter := configmap.NewTCPServicesConverter(c.options, c.haproxy, changed)
tcpSvcConverter.Sync()
c.timer.Tick("parse_tcp_svc")
Expand Down

0 comments on commit 6796c83

Please sign in to comment.