pulumi / pulumi-gcp

A Google Cloud Platform (GCP) Pulumi resource package, providing multi-language access to GCP
Apache License 2.0
180 stars 52 forks source link

Cloud Run `pulumiLabels` mapped non-uniquely to `terraform_labels` #1843

Closed xSAVIKx closed 6 months ago

xSAVIKx commented 6 months ago

What happened?

Cloud Run service deployment fails with instance state: internal: Pulumi property 'pulumiLabels' mapped non-uniquely to Terraform attribute 'terraform_labels' (duplicates Pulumi key 'terraformLabels').

Example

gcp.cloudrun.Service(
    resource_name=f"test-gcr",
    args=gcp.cloudrun.ServiceArgs(
        name="test",
        location="europe-west2",
        template=gcp.cloudrun.ServiceTemplateArgs(
            spec=gcp.cloudrun.ServiceTemplateSpecArgs(
                service_account_name="test@project.iam.gserviceaccount.com",
                containers=[
                    gcp.cloudrun.ServiceTemplateSpecContainerArgs(
                        image="gcr.io/example",
                        resources=gcp.cloudrun.ServiceTemplateSpecContainerResourcesArgs(
                            limits={
                                "memory": f"512Mi",
                                "cpu": "1",
                            }
                        ),
                    )
                ],
                timeout_seconds=60,
                container_concurrency=30,
            ),
            metadata=gcp.cloudrun.ServiceTemplateMetadataArgs(
                annotations={
                    "autoscaling.knative.dev/maxScale": "100",
                },
            ),
        ),
        autogenerate_revision_name=True,
        metadata=gcp.cloudrun.ServiceMetadataArgs(
            labels={"env": "dev"},
            annotations={
                "run.googleapis.com/ingress": "all",
            },
        ),
        traffics=[
            gcp.cloudrun.ServiceTrafficArgs(
                percent=100,
                latest_revision=True,
            )
        ],
        project="gcp-project",
    ),
)

Output of pulumi about

CLI Version      3.111.1
Go Version   go1.22.1
Go Compiler  gc

Plugins
NAME    VERSION
docker  4.5.1
gcp     7.14.0
python  unknown

Host     
OS       ubuntu
Version  22.04
Arch     x86_64

Found no pending operations associated with travelshift/dev

Backend        
Name           pulumi.com
Token type     personal

Dependencies:
NAME                                     VERSION
annotated-types                          0.6.0
async-timeout                            4.0.3
backcall                                 0.2.0
blacken-docs                             1.16.0
bump-pydantic                            0.7.0
Cerberus                                 1.3.5
cmapy                                    0.6.6
contourpy                                1.2.0
cycler                                   0.12.1
flake8                                   7.0.0
fonttools                                4.50.0
fqdn                                     1.5.1
get-country-street-networks              0.10.0
google-api-python-client-stubs           1.23.0
google-cloud-monitoring                  2.18.0
httpcore                                 0.17.3
isoduration                              20.11.0
jsonpointer                              2.4
jupytext                                 1.16.1
kiwisolver                               1.4.5
knowledge-graph                          0.1.0
lazy-object-proxy                        1.10.0
memray                                   1.10.0
munch                                    2.5.0
mypy                                     1.7.1
mypy-boto3-s3                            1.34.65
mypy-boto3-sns                           1.34.44
nbqa                                     1.7.1
pandas-stubs                             1.5.3.230321
pickleshare                              0.7.5
pillow                                   10.2.0
pip-api                                  0.0.30
pipreqs                                  0.4.13
playwright                               1.42.0
pre-commit                               3.6.2
psycopg-binary                           3.1.17
psycopg-pool                             3.2.1
pubsub-cleaner                           0.5.2
pydantic_core                            2.10.1
pylint                                   3.1.0
pyppeteer                                1.0.2
pyrsistent                               0.19.3
pytest-unordered                         0.6.0
pyupgrade                                3.15.1
requirementslib                          3.0.0
ruff                                     0.3.3
setuptools-scm                           8.0.4
types-google-cloud-ndb                   2.1.0.6
types-protobuf                           4.24.0.20240311
types-psutil                             5.9.5.20240316
types-PyYAML                             6.0.12.20240311
types-requests                           2.31.0.20240311
types-tqdm                               4.66.0.2
types-urllib3                            1.26.25.14
types-xmltodict                          0.13.0.3
uri-template                             1.3.0
vcrpy                                    5.1.0
webcolors                                1.13
wheel                                    0.38.4

Additional context

This happens with pulumi-gcp versions from 7.11.0 to 7.14.0.

Rolling back to 7.9.0 fixes the issue.

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).

guineveresaenger commented 6 months ago

Hi @xSAVIKx - thank you for filing this bug. We'll take a look as soon as we can.

michaelgmiller1 commented 6 months ago

we're also getting hit with this since we upgrade pulumi from 3.89.0 to 3.111.1 and pulumi-gcp from 6.67.0 to 7.14.0. Since this is blocking us from upgrading, would be good to get addressed soon!

VenelinMartinov commented 6 months ago

Ok, reproed the issue in https://github.com/pulumi/pulumi-gcp/pull/1854. Looks like this is already fixed in tf-bridge master in https://github.com/pulumi/pulumi-terraform-bridge/pull/1757. I've kicked off a release and will update here once we pick it up. We should have a release by EOD if nothing goes wrong.

VenelinMartinov commented 6 months ago

https://github.com/pulumi/pulumi-gcp/releases/tag/v7.14.1 released and has a fix for the issue. LMK If you are still having issues with this.

xSAVIKx commented 6 months ago

I've had to re-create the env from scratch and migrated to cloudrunv2 package, so don't have an env to test it out. Hopefully it's gonna be fixed for others 😄