Skip to content

pulumi config set gcp:disableGlobalProjectWarning true does not work #2928

Closed
@iwahbe

Description

@iwahbe

Describe what happened

Following up on #1168 (comment):

Given a warning like:

$ Previewing update (pulumi/dev)

View in Browser (Ctrl+O): https://app.pulumi.com/pulumi/dev-yaml/dev/previews/dc970820-3e12-4026-a12a-dbdc44e6c9fc

     Type                 Name          Plan     Info
     pulumi:pulumi:Stack  dev-yaml-dev           warning: using pulumi-language-yaml from $PATH at /Us
     Type                     Name          Plan       Info
 +   pulumi:pulumi:Stack      dev-yaml-dev  create     1 warning
     ├─ pulumi:providers:gcp  default                  1 warning; 1 message
 +   └─ gcp:storage:Bucket    bucket        create     

Policies:
    ✅ [email protected]

Diagnostics:
  pulumi:providers:gcp (default):
    resource.PropertyMap{"disableGlobalProjectWarning":resource.PropertyValue{V:"true"}}
    warning: unable to detect a global setting for GCP Project.
    Pulumi will rely on per-resource settings for this operation.
    Set the GCP Project by using:
        `pulumi config set gcp:project <project>`
    If you would like to disable this warning use:
        `pulumi config set gcp:disableGlobalProjectWarning true`

  pulumi:pulumi:Stack (dev-yaml-dev):
    warning: using pulumi-language-yaml from $PATH at /Users/ianwahbe/.pulumi/bin/pulumi-language-yaml

Resources:
    + 2 to create

Doing the obvious thing doesn't work:

$ pulumi config set gcp:disableGlobalProjectWarning true
$ pulumi up

This is follow-up on #1168 (comment).

Sample program

# Pulumi.yaml
name: dev-yaml
runtime: yaml
resources:
  bucket:
    type: gcp:storage:Bucket
    properties:
      project: pulumi-development
      location: us-west1
# Pulumi.dev.yaml
config:
  gcp:disableGlobalProjectWarning: true

Log output

The relevant logs are:

{
    "method": "/pulumirpc.ResourceProvider/CheckConfig",
    "request": {
        "urn": "urn:pulumi:dev::dev-yaml::pulumi:providers:gcp::default",
        "olds": {},
        "news": {
            "disableGlobalProjectWarning": "true"
        },
        "name": "default",
        "type": "pulumi:providers:gcp"
    },
    "response": {
        "inputs": {
            "disableGlobalProjectWarning": "true"
        }
    },
    "metadata": {
        "kind": "resource",
        "mode": "client",
        "name": "gcp"
    }
}
{
    "method": "/pulumirpc.ResourceProvider/Configure",
    "request": {
        "variables": {
            "gcp:config:disableGlobalProjectWarning": "true"
        },
        "args": {
            "disableGlobalProjectWarning": "true"
        },
        "acceptSecrets": true,
        "acceptResources": true,
        "sendsOldInputs": true,
        "sendsOldInputsToDelete": true
    },
    "response": {
        "supportsPreview": true,
        "supportsAutonamingConfiguration": true
    },
    "metadata": {
        "kind": "resource",
        "mode": "client",
        "name": "gcp"
    }
}

Affected Resource(s)

No response

Output of pulumi about

CLI          
Version      3.147.1-dev.0
Go Version   go1.23.4
Go Compiler  gc

Plugins
KIND      NAME  VERSION
resource  gcp   unknown
language  yaml  1.13.0

Host     
OS       darwin
Version  15.1.1
Arch     arm64

This project is written in yaml

Current Stack: pulumi/dev-yaml/dev

Found no resources associated with pulumi/dev

Found no pending operations associated with pulumi/dev

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/ian-pulumi-corp
User           ian-pulumi-corp
Organizations  ian-pulumi-corp, pulumi
Token type     personal

Dependencies:
NAME  VERSION
gcp   

Pulumi locates its logs in /var/folders/fg/_1q36r4j6yx0rwz2fbhjd5y40000gn/T/ by default

Additional context

Observe that the type for disableGlobalProjectWarning is string, even though we specify a bool:

"disableGlobalProjectWarning": {
Schema: shimv2.NewSchema(&schema.Schema{
Type: schema.TypeBool,
Optional: true,
}),
Info: &tfbridge.SchemaInfo{
Default: &tfbridge.DefaultInfo{
Value: false,
EnvVars: []string{"PULUMI_GCP_DISABLE_GLOBAL_PROJECT_WARNING"},
},
},
},

We only act on a bool:

if project == "" {
if !tfbridge.ConfigBoolValue(
vars, "disableGlobalProjectWarning",
[]string{"PULUMI_GCP_DISABLE_GLOBAL_PROJECT_WARNING"},
) {
tfbridge.GetLogger(ctx).Warn(noProjectErr)
}
return nil
}

This is ultimately caused by pulumi/pulumi#17667.

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

Metadata

Metadata

Assignees

Labels

kind/bugSome behavior is incorrect or out of specresolution/fixedThis issue was fixed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions