Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hugo deploy --dryRun invalidates cloudfront cache #7884

Closed
srsudar opened this issue Oct 25, 2020 · 1 comment · Fixed by #7895
Closed

hugo deploy --dryRun invalidates cloudfront cache #7884

srsudar opened this issue Oct 25, 2020 · 1 comment · Fixed by #7895
Milestone

Comments

@srsudar
Copy link

srsudar commented Oct 25, 2020

What version of Hugo are you using (hugo version)?

$ hugo version
Hugo Static Site Generator v0.76.5/extended darwin/amd64 BuildDate: unknown

Does this issue reproduce with the latest release?

I believe I'm on the latest release.

Description

I expected the hugo deploy --dryRun flag to do nothing to my deployment. To my surprise, however, it seems like it might actually be interacting with my server. Example output:

$ hugo deploy --dryRun
Deploying to target "foo" (s3://foo.com)
Identified 68 file(s) to upload, totaling 846 kB, and 0 file(s) to delete.
<snip>
[DRY RUN] Would upload: tags/web/index.html (6.8 kB, Content-Type: "text/html"): size differs
[DRY RUN] Would upload: tags/web/index.xml (1.4 kB, Content-Type: "application/rss+xml"): size differs
Success!
Invalidating CloudFront CDN...
Failed to invalidate CloudFront CDN: AccessDenied: User: arn:aws:iam::<snip> is not authorized to perform: cloudfront:CreateInvalidation on resource: arn:aws:cloudfront::<snip>
        status code: 403, request id: <snip>
Error: AccessDenied: User: arn:aws:iam::<snip> is not authorized to perform: cloudfront:CreateInvalidation on resource: arn:aws:cloudfront::<snip>
        status code: 403, request id: <snip>

In #7125 someone says --dryRun doesn't catch cloudfront errors, which makes me think behavior has changed here.

Am I misunderstanding something? I would expect that --dryRun would mean my server won't be modified.

@bep bep added the Bug label Oct 25, 2020
@bep bep added this to the v0.77 milestone Oct 25, 2020
zemanel added a commit to zemanel/hugo that referenced this issue Oct 27, 2020
… deployment

Currently, if cache invalidation is enabled when running `hugo deploy --dryRun` with , the deployer does not take the dry run flag into consideration and triggers CloudFront/GoogleCloudCDN cache invalidation if any of those services are configured.

This change will instead print a feedback message if a dry run is in effect and quiet mode is not enabled.

Fixes gohugoio#7884
@bep bep closed this as completed in #7895 Oct 28, 2020
bep pushed a commit that referenced this issue Oct 28, 2020
… deployment

Currently, if cache invalidation is enabled when running `hugo deploy --dryRun` with , the deployer does not take the dry run flag into consideration and triggers CloudFront/GoogleCloudCDN cache invalidation if any of those services are configured.

This change will instead print a feedback message if a dry run is in effect and quiet mode is not enabled.

Fixes #7884
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants