Skip to content

Commit 41103c8

Browse files
committed
Only update upstreams if config was applied
1 parent 587041e commit 41103c8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

internal/mode/static/handler.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,7 @@ func (h *eventHandlerImpl) HandleEventBatch(ctx context.Context, logger logr.Log
164164
h.cfg.graphBuiltHealthChecker.setAsReady()
165165
}
166166

167-
// TODO(sberman): if nginx Deployment is scaled up, we need to trigger an update for it to send
168-
// the config to the new pod
169-
// If scaled down, we should remove the pod from the ConnectionsTracker
167+
// TODO(sberman): if nginx Deployment is scaled down, we should remove the pod from the ConnectionsTracker
170168
// If fully deleted, then delete the deployment from the Store
171169
var err error
172170
var configApplied bool
@@ -326,7 +324,7 @@ func (h *eventHandlerImpl) updateNginxConf(ctx context.Context, conf dataplane.C
326324

327325
// If using NGINX Plus, update upstream servers using the API.
328326
var plusApplied bool
329-
if h.cfg.plus {
327+
if h.cfg.plus && applied {
330328
plusApplied, err = h.cfg.nginxUpdater.UpdateUpstreamServers(ctx, deployment, conf)
331329
if err != nil {
332330
return false, err

0 commit comments

Comments
 (0)