fix(deploy-cloudrun): preserve sidecar containers on deploy#414
Merged
Conversation
The deploy collapsed each service to template.containers[0] and replaced the whole container list with it (updateMask: template.containers), so any sidecar was dropped on every deploy — and the deploy failed outright when the app declared depends_on the sidecar (the carried-over depends_on referenced a container that was no longer in the list). This breaks the Datadog Agent sidecar the gcp/cloudrun/app module adds when datadog_apm = true. Update only the app container's image/env and pass the full container list through, so sidecars survive. The app container is the one running this project's image (the imageUri repo) or the ingress container (the one with a port) before the first build; single-container services keep today's behavior. updateService now takes the full containers array. lint/build/tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
davidhollenberger
approved these changes
Jun 30, 2026
Release the deploy-cloudrun sidecar-preservation fix. build-dist.yml reads package.json on merge to main and moves the rolling v1 tag (and v1.7.1) to the new commit, so @v1 consumers (bills, etc.) pick up the fix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
actions/deploy-cloudrunupdated each service by grabbingtemplate.containers[0], setting its image/env, and callingupdateServicewith just that one container — which sendstemplate.containers: [one]withupdateMask: ["template.containers"], replacing the entire container list. So any sidecar is dropped on every deploy, and when the app declaresdepends_onthe sidecar, the carried-overdepends_onreferences a missing container → Cloud Run rejects the update → the deploy fails.This blocks the Datadog Agent sidecar that
gcp/cloudrun/appadds whendatadog_apm = true(cru-terraform-modules#667).Fix
Update only the app container's image/env and pass the full container list through, so sidecars survive:
imageUrirepo) or, before the first build, the ingress container (the one with a port).updateServicenow takes the fullcontainersarray.Verification
npm run lint,npm run build(9 actions), andnpm test(29 passing) pass.dist/not committed —build-dist.ymlrebuilds it on merge.Release
Bumped
package.json(+ lockfile) to 1.7.1. On merge,build-dist.ymlrebuildsdist/and moves the rollingv1tag (andv1.7.1) to the new commit, so@v1consumers (bills, etc.) pick up the fix. (TheCheck Release Labelworkflow is a vendored import from another team — not part of this repo's release path — so nopatchlabel is needed.)Rollout note
Needs to be merged (→
v1moves) before a bills stage deploy runs with the sidecar (cru-terraform#11096), or that deploy drops/fails on the agent.🤖 Generated with Claude Code