Compare secret data when reconciling listener config and proxy secrets#4565
Open
Okabe-Junya wants to merge 2 commits into
Open
Compare secret data when reconciling listener config and proxy secrets#4565Okabe-Junya wants to merge 2 commits into
Okabe-Junya wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves secret reconciliation for AutoscalingListener so rotated GitHub credentials (and related integrity-hash changes) propagate into the listener’s generated Secrets instead of only patching metadata and masking drift.
Changes:
- Compare
listenerConfigSecret.Datato the desired secret and patch data when it differs. - Add analogous data comparison/update logic for the listener proxy secret.
- Add a controller test asserting rotated GitHub credentials propagate into the listener config secret.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| controllers/actions.github.com/autoscalinglistener_controller.go | Adds Secret.Data drift detection and patches to converge listener config/proxy secrets. |
| controllers/actions.github.com/autoscalinglistener_controller_test.go | Adds an integration test validating rotated GitHub credentials update the listener config secret. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What
Why
Both update paths compared only labels and annotations, so
desiredSecret.Data- built from the current GitHub credentials - was discarded and a rotated GitHub App key / PAT never reached the listener.Worse, the desired secret's
actions.github.com/integrity-hashannotation (computed from the data) was patched, so the listener pod was recreated while still mounting the stale secret, and the drift stayed masked afterwards. Once the old key is revoked, the listener crash-loops on authentication and the scale set stops acquiring jobs until the config secret or theAutoscalingListeneris recreated manually.Propagation still requires a reconcile of the
AutoscalingListener(there is no watch on the user-managed credentials secret - out of scope here), but any reconcile now converges the data instead of masking the drift