Repository navigation
fix(cloudfront): log errors in waitUntilDeployed instead of silently retrying [PE1-6037] - #131
Closed
LCaparelli wants to merge 1 commit into
Closed
LCaparelli wants to merge 1 commit into
LCaparelli wants to merge 1 commit into
Conversation
…retrying Non-NoSuchDistribution errors from GetDistribution were silently swallowed, making IAM permission issues invisible during deletion.
LCaparelli
force-pushed
the
fix/PE1-6037-getdistribution-iam
branch
from
July 2, 2026 21:29
72c245b to
9fedbcb
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR makes CloudFront waitUntilDeployed retries observable by logging non-NoSuchDistribution errors returned by GetDistribution, avoiding silent retry loops that only end in a timeout.
Changes:
- Add
log.Printffor unexpectedGetDistributionerrors before returning(false, nil)(retry). - Import Go’s standard
logpackage to emit the message.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
294
to
295
| var eTag *string | ||
| condition := func(context.Context) (done bool, err error) { |
| "context" | ||
| "errors" | ||
| "fmt" | ||
| "log" |
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.
Description
Adds a log line in
waitUntilDeployedfor non-NoSuchDistributionerrors fromGetDistribution, so they are visible in controller logs instead of being silently swallowed.Motivation and Context
The
waitUntilDeployedcondition function was silently returning(false, nil)for all errors exceptNoSuchDistribution, causing the poll loop to retry until timeout without any log output. This made it impossible to diagnose issues like missing IAM permissions (cloudfront:GetDistribution) from controller logs alone — the only symptom was a genericcontext deadline exceeded.Jira: https://gympass.atlassian.net/browse/PE1-6037
How has this been tested?
Checklist
I have updated the documentation accordingly.