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

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

Open
iwahbe opened this issue Jan 31, 2025 · 0 comments · May be fixed by #2929
Open

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

iwahbe opened this issue Jan 31, 2025 · 0 comments · May be fixed by #2929
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@iwahbe
Copy link
Member

iwahbe commented Jan 31, 2025

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

@iwahbe iwahbe added the kind/bug Some behavior is incorrect or out of spec label Jan 31, 2025
@pulumi-bot pulumi-bot added the needs-triage Needs attention from the triage team label Jan 31, 2025
@iwahbe iwahbe self-assigned this Jan 31, 2025
iwahbe added a commit that referenced this issue Jan 31, 2025
For information on both the issue and the solution, please read #2928.

Fixes #2928
@iwahbe iwahbe linked a pull request Jan 31, 2025 that will close this issue
@VenelinMartinov VenelinMartinov removed the needs-triage Needs attention from the triage team label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants