Fix secret reconciliation updates for the listener pod#4492
Open
nikola-jokic wants to merge 3 commits intomasterfrom
Open
Fix secret reconciliation updates for the listener pod#4492nikola-jokic wants to merge 3 commits intomasterfrom
nikola-jokic wants to merge 3 commits intomasterfrom
Conversation
Contributor
|
Hello! Thank you for your contribution. Please review our contribution guidelines to understand the project's testing and code conventions. |
Contributor
There was a problem hiding this comment.
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
FailedMounterrors. - 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 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4450