Has there been any progress or workaround for <ht...
# google-cloud
b
Has there been any progress or workaround for https://github.com/pulumi/pulumi-gcp/issues/827? This issue is holding us back switching from manually running Pulumi to running it in CI. We currently create services with Pulumi, but deploy updates using gcloud which sets annotations and updates the image which will diff in Pulumi after a refresh.
f
I’m doing a similar thing, and I just specify an “initial” image when I create the cloud run service, and then let the cloud build update the image that the cloud run service each time it builds. Not sure if it helps, but my ignore block looks like (golang):
Copy code
}, pulumi.IgnoreChanges(
				[]string{
					`template["spec"]["containers"][0]["image"]`,
					`template.metadata.annotations`,
					`template.metadata.labels.commit-sha`,
					`template.metadata.labels.gcb-build-id`,
				}),
I had to fiddle around with the different possible formats of the ignore changes in order to get it to actually work, but the pulumi is running clean despite many builds on each of the services (resulting in a new image)
b
Yeah that's what I've been doing. An issue arise when I refresh the stack after having deployed another image using gcloud- Pulumi then wants to revert it back to the initial image. I have expected the ignores to allow us to workaround it, but I've also struggled to get the patterns right. I'll give those ignores a go and I'll report back how we get on. Thanks!
👍 1
I still can't seem to make this work. Using the image attribute pattern above I get
Copy code
error: gcp:cloudrun/service:Service resource 'x' has a problem: Missing required argument: The argument "template.0.spec.0.containers.0.image" is required, but no definition was found.. Examine values at 'Service.Template.Spec[0].Containers[0].Ports'.
My
pulumi-gcp
version is v6.29.0.
Using exactly the above patterns (as in all of them and removing any others), the error is similar but instead complains on the `.Resource`:
Copy code
error: gcp:cloudrun/service:Service resource 'x' has a problem: Missing required argument: The argument "template.0.spec.0.containers.0.image" is required, but no definition was found.. Examine values at 'Service.Template.Spec[0].Containers[0].Resources'.
f
I think maybe what I've been doing is a refresh before apply. Not sure if that's why I'm seeing better results or not