Skip to content

Fix secret reconciliation updates for the listener pod#4492

Open
nikola-jokic wants to merge 3 commits intomasterfrom
nikola-jokic/listener-secret
Open

Fix secret reconciliation updates for the listener pod#4492
nikola-jokic wants to merge 3 commits intomasterfrom
nikola-jokic/listener-secret

Conversation

@nikola-jokic
Copy link
Copy Markdown
Collaborator

Fixes #4450

Copilot AI review requested due to automatic review settings May 8, 2026 21:38
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Hello! Thank you for your contribution.

Please review our contribution guidelines to understand the project's testing and code conventions.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the race condition reported in #4450 by ensuring the listener config Secret is no longer deleted as part of listener pod termination, and instead is reconciled (created/updated) in-place with drift detection so the pod can be restarted only when the Secret content changes.

Changes:

  • Stop deleting the listener config Secret when deleting/restarting the listener pod to avoid intermittent FailedMount errors.
  • Add reconciliation for the listener config Secret (create/update with drift detection) and restart the listener pod when the Secret changes.
  • Update controller tests to assert the config Secret persists across listener pod recreation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
controllers/actions.github.com/autoscalinglistener_controller.go Reconciles listener config Secret in-place and restarts listener pod when the Secret drifts; removes Secret deletion during pod termination.
controllers/actions.github.com/autoscalinglistener_controller_test.go Updates the termination behavior test to assert the config Secret is preserved (UID unchanged) across pod recreation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread controllers/actions.github.com/autoscalinglistener_controller.go Outdated
Comment on lines +263 to +267
// If listener config secret changed and pod exists, restart the pod
if secretChanged {
log.Info("Listener config secret changed, restarting listener pod")
return ctrl.Result{}, r.deleteListenerPod(ctx, autoscalingListener, listenerPod, log)
}
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Race condition in deleteListenerPod causes intermittent FailedMount errors

2 participants