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

Cloudrun service fix 409 conflict due to not refreshing by default #2622

Merged
merged 4 commits into from
Nov 14, 2024

Conversation

rshade
Copy link
Contributor

@rshade rshade commented Nov 12, 2024

This change fixes an issue with the cloud_run_service resource which causes a 409 conflict with the service whenever there is a change outside of pulumi. The conflict is caused by the resourceVersion property in the metadata blob, which is used for optimistic locking.

This change adds a TransformFromState hook to the resource which deletes the resourceVersion from the state. This disables the optimistic locking behaviour and prevents the 409 conflicts caused by changes to the resource.

fixes #350

Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Maintainer note: consult the runbook for dealing with any breaking changes.

Copy link
Contributor

@VenelinMartinov VenelinMartinov left a comment

Choose a reason for hiding this comment

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

Looks sensible! Can you please add a test for this similar to

func TestFirestoreBackupScheduleNoPermadiff(t *testing.T) {

provider/resources.go Outdated Show resolved Hide resolved
@rshade rshade force-pushed the rshade/issue-350 branch 5 times, most recently from 8e18093 to 6bb68cc Compare November 13, 2024 23:19
@VenelinMartinov VenelinMartinov changed the title Rshade/issue 350 Cloudrun service fix 409 conflict due to not refreshing by default Nov 14, 2024
Copy link
Contributor

@VenelinMartinov VenelinMartinov left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for adding the test!

Copy link
Contributor

@VenelinMartinov VenelinMartinov left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for adding the test!

I also edited the title and description of the PR, I hope you don't mind. It tends to be useful for future people trying to figure out why we've done these changes.

@rshade rshade merged commit c606be5 into master Nov 14, 2024
23 checks passed
@rshade rshade deleted the rshade/issue-350 branch November 14, 2024 11:50
@pulumi-bot
Copy link
Contributor

This PR has been shipped in release v8.9.2.

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.

Deploying new revisions of Cloud Run resources yields 409: Conflict
3 participants