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

GCP Cloud Run v2 service always being updated when launch_stage is BETA while using python sdk #2336

Open
nabheet opened this issue Aug 19, 2024 · 2 comments
Labels
awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). blocked The issue cannot be resolved without 3rd party action. kind/bug Some behavior is incorrect or out of spec

Comments

@nabheet
Copy link

nabheet commented Aug 19, 2024

What happened?

We have a GCP Cloud Run V2 service defined in Pulumi. When I use the launch_stage="BETA" , Pulumi always updates the service instance. Even when nothing has changed.

However, it does not update the service instance if launch_state="BETA" is not specified.

We were hoping that the specification of launch_stage does not automatically update the service on every deployment.

Example

We have a Cloud Run v2 service like this:

cloud_run_service = cloudrunv2.Service(
            "{}-cloud-run-service".format(service_name),
            location=region,
            name=service_name,
            project=project_id,
            client="gcloud",
            custom_audiences=custom_audiences,
            launch_stage="BETA",
            scaling=cloudrunv2.ServiceScalingArgs(
                min_instance_count=min_scale,
            ),
            template=cloudrunv2.ServiceTemplateArgs(
                scaling=cloudrunv2.ServiceTemplateScalingArgs(
                    max_instance_count=max_scale,
                    min_instance_count=0,
                ),
                containers=containers,
                volumes=volumes,
                service_account=service_account,
                max_instance_request_concurrency=container_concurrency,
                timeout=f"{timeout_seconds}s",
                vpc_access=cloudrunv2.ServiceTemplateVpcAccessArgs(
                    network_interfaces=[
                        cloudrunv2.ServiceTemplateVpcAccessNetworkInterfaceArgs(
                            network=default_network.name,
                            subnetwork=cloud_run_subnet.name,
                        )
                    ],
                    egress="ALL_TRAFFIC",
                ),
                execution_environment="EXECUTION_ENVIRONMENT_GEN2",
            ),
            ingress="INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER",
            opts=ResourceOptions(
                aliases=[Alias(name=service_name)],
                delete_before_replace=True,
                depends_on=dependencies,
                ignore_changes=[
                    "template.containers[0].image",
                    "template.containers[0].commands",
                    "template.containers[0].args",
                    "clientVersion",
                ],
            ),
        )

Pulumi updates the service on every execution reporting:

~ gcp:cloudrunv2/service:Service: (update)
        [id=projects/PROJECT_ID/locations/us-central1/services/SERVICE_NAME]
        [urn=urn:pulumi:BLA_BLA::PROJECT_ID::gcp:cloudrunv2/service:Service::SERVICE_NAME_BLA_BLA]
        [provider=urn:pulumi:BLA_BLA::PROJECT_ID::pulumi:providers:gcp::default_7_32_0::4e01aa79-5e47-4fc4-86e9-4a34aeb920b9]
      ~ launchStage: "GA" => "BETA"
      + scaling    : {
          + minInstanceCount: 0
        }
      + scaling    : {
          + minInstanceCount: 0
        }

I believe pulumi should not update the service if nothing has changed.

Output of pulumi about

$ pulumi about
CLI          
Version      3.129.0
Go Version   go1.22.6
Go Compiler  gc

Host     
OS       debian
Version  12.6
Arch     aarch64

Backend        
Name           pulumi.com
URL            https://app.pulumi.com
User           Unknown
Organizations  
Token type     personal

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@nabheet nabheet added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Aug 19, 2024
@justinvp
Copy link
Member

Hi @nabheet, thanks for opening the issue. This looks specific to the GCP provider, so I'm going to transfer the issue there. From a cursory look, this may be an issue in the upstream provider: hashicorp/terraform-provider-google#13748

@justinvp justinvp transferred this issue from pulumi/pulumi Aug 21, 2024
@iwahbe iwahbe added awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). blocked The issue cannot be resolved without 3rd party action. and removed needs-triage Needs attention from the triage team labels Aug 22, 2024
@iwahbe
Copy link
Member

iwahbe commented Aug 22, 2024

Hi @nabheet. This (pulumi-gcp) is indeed the correct repo to house this issue. I agree with @justinvp, this is an upstream issue. As soon as they take a fix for hashicorp/terraform-provider-google#13748, we will incorporate it into pulumi-gcp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). blocked The issue cannot be resolved without 3rd party action. kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants