Skip to content

Compare secret data when reconciling listener config and proxy secrets#4565

Open
Okabe-Junya wants to merge 2 commits into
actions:masterfrom
Okabe-Junya:Okabe-Junya/fix/listener-config-secret-rotation
Open

Compare secret data when reconciling listener config and proxy secrets#4565
Okabe-Junya wants to merge 2 commits into
actions:masterfrom
Okabe-Junya:Okabe-Junya/fix/listener-config-secret-rotation

Conversation

@Okabe-Junya

@Okabe-Junya Okabe-Junya commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

What

  • Compare the listener config secret's Data against the desired state and include it in the patch when it differs, so rotated GitHub credentials propagate to the listener.
  • Apply the same Data comparison to the listener proxy secret

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-hash annotation (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 the AutoscalingListener is 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

@Okabe-Junya Okabe-Junya marked this pull request as ready for review July 12, 2026 15:19
Copilot AI review requested due to automatic review settings July 12, 2026 15:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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.Data to 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.

Comment thread controllers/actions.github.com/autoscalinglistener_controller.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

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.

2 participants