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

Stack outputs shown when using --suppress-outputs combined with --json #2765

Closed
casey-robertson opened this issue May 23, 2019 · 0 comments · Fixed by #2771
Closed

Stack outputs shown when using --suppress-outputs combined with --json #2765

casey-robertson opened this issue May 23, 2019 · 0 comments · Fixed by #2771
Assignees
Labels
area/cli UX of using the CLI (args, output, logs) kind/bug Some behavior is incorrect or out of spec
Milestone

Comments

@casey-robertson
Copy link

Sample app:

import * as gcp from '@pulumi/gcp';

// Create a GCP resource (Storage Bucket)
export const bucket = new gcp.storage.Bucket('testBucket', {
  name: 'mytestbucketforjson',
  project: 'mindbody-casey-robertson'
});

new gcp.storage.BucketIAMMember(
  'my-bucket-iam',
  {
    bucket: bucket.name,
    member: 'allUsers',
    role: 'roles/storage.objectViewer'
  },
  {
    // Track Pulumi component by attaching to parent.
    // https://pulumi.io/reference/programming-model.html#components
    parent: bucket
  }
);

// Export the DNS name of the bucket
export const bucketName = bucket.url;

Program run - pulumi up -y

pulumi up -y
Previewing update (dev):

     Type                               Name             Plan
 +   pulumi:pulumi:Stack                bucket-test-dev  create
 +   └─ gcp:storage:Bucket              testBucket       create
 +      └─ gcp:storage:BucketIAMMember  my-bucket-iam    create

Resources:
    + 3 to create

Updating (dev):

     Type                               Name             Status
 +   pulumi:pulumi:Stack                bucket-test-dev  created
 +   └─ gcp:storage:Bucket              testBucket       created
 +      └─ gcp:storage:BucketIAMMember  my-bucket-iam    created

Outputs:
    bucket    : {
        forceDestroy  : false
        id            : "mytestbucketforjson"
        location      : "US"
        name          : "mytestbucketforjson"
        project       : "mindbody-casey-robertson"
        requesterPays : false
        selfLink      : "https://www.googleapis.com/storage/v1/b/mytestbucketforjson"
        storageClass  : "STANDARD"
        url           : "gs://mytestbucketforjson"
        urn           : "urn:pulumi:dev::bucket-test::gcp:storage/bucket:Bucket::testBucket"
    }
    bucketName: "gs://mytestbucketforjson"

Resources:
    + 3 created

Duration: 7s

Re-run with `pulumi preview --json --suppress-outputs

{
    "config": {
        "gcp:project": "mindbody-casey-robertson"
    },
    "steps": [
        {
            "op": "same",
            "urn": "urn:pulumi:dev::bucket-test::pulumi:pulumi:Stack::bucket-test-dev",
            "oldState": {
                "urn": "urn:pulumi:dev::bucket-test::pulumi:pulumi:Stack::bucket-test-dev",
                "custom": false,
                "type": "pulumi:pulumi:Stack",
                "outputs": {
                    "bucket": {
                        "cors": [],
                        "forceDestroy": false,
                        "id": "mytestbucketforjson",
                        "labels": {},
                        "lifecycleRules": [],
                        "location": "US",
                        "name": "mytestbucketforjson",
                        "project": "mindbody-casey-robertson",
                        "requesterPays": false,
                        "selfLink": "https://www.googleapis.com/storage/v1/b/mytestbucketforjson",
                        "storageClass": "STANDARD",
                        "url": "gs://mytestbucketforjson",
                        "urn": "urn:pulumi:dev::bucket-test::gcp:storage/bucket:Bucket::testBucket"
                    },
                    "bucketName": "gs://mytestbucketforjson"
                }
            },
            "newState": {
                "urn": "urn:pulumi:dev::bucket-test::pulumi:pulumi:Stack::bucket-test-dev",
                "custom": false,
                "type": "pulumi:pulumi:Stack",
                "outputs": {
                    "bucket": {
                        "cors": [],
                        "forceDestroy": false,
                        "id": "mytestbucketforjson",
                        "labels": {},
                        "lifecycleRules": [],
                        "location": "US",
                        "name": "mytestbucketforjson",
                        "project": "mindbody-casey-robertson",
                        "requesterPays": false,
                        "selfLink": "https://www.googleapis.com/storage/v1/b/mytestbucketforjson",
                        "storageClass": "STANDARD",
                        "url": "gs://mytestbucketforjson",
                        "urn": "urn:pulumi:dev::bucket-test::gcp:storage/bucket:Bucket::testBucket"
                    },
                    "bucketName": "gs://mytestbucketforjson"
                }
            }
        }
    ],
    "changeSummary": {
        "same": 3
    }

Expected behavior based on the flag would be that the outputs key in the states would not be down.

@joeduffy joeduffy self-assigned this May 23, 2019
@joeduffy joeduffy added area/cli UX of using the CLI (args, output, logs) kind/bug Some behavior is incorrect or out of spec labels May 23, 2019
@joeduffy joeduffy added this to the 0.23 milestone May 23, 2019
joeduffy added a commit that referenced this issue May 24, 2019
If --suppress-outputs is passed to `pulumi preview --json`, we
should not emit the stack outputs. This change fixes #2765.

Also adds a test case for this plus some variants of updates.
joeduffy added a commit that referenced this issue May 24, 2019
If --suppress-outputs is passed to `pulumi preview --json`, we
should not emit the stack outputs. This change fixes #2765.

Also adds a test case for this plus some variants of updates.
joeduffy added a commit that referenced this issue May 25, 2019
If --suppress-outputs is passed to `pulumi preview --json`, we
should not emit the stack outputs. This change fixes #2765.

Also adds a test case for this plus some variants of updates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli UX of using the CLI (args, output, logs) kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants