-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Discard log messages when initializing the provider (#4650)
Messages sent early to the "log" package end up being forwarded to stderr, and Pulumi displays stderr by default to users, which is undesirable. Later in the provider life-cycle, Pulumi Terraform Bridge will reset `log.SetOutput` again to capture and appropriately track diagnostic logs, which should still work with this change. Fixes #4645 A test is added to ensure we do not leak diagnostics again on a simple program.
- Loading branch information
Showing
6 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
provider/test-programs/disappearing-bucket-object/Pulumi.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
name: disappearing-bucket-object | ||
runtime: nodejs |
13 changes: 13 additions & 0 deletions
13
provider/test-programs/disappearing-bucket-object/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as aws from "@pulumi/aws"; | ||
import * as pulumi from "@pulumi/pulumi"; | ||
|
||
const cfg = new pulumi.Config(); | ||
const b = new aws.s3.BucketV2("my-bucket", {}); | ||
|
||
if (cfg.get("bucket-object") !== "exclude") { | ||
const o = new aws.s3.BucketObjectv2("obj", { | ||
bucket: b.bucket, | ||
key: "index.ts", | ||
source: new pulumi.asset.FileAsset("index.ts"), | ||
}); | ||
} |
15 changes: 15 additions & 0 deletions
15
provider/test-programs/disappearing-bucket-object/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "disappearing-bucket-object", | ||
"version": "0.1.0", | ||
"license": "Apache-2.0", | ||
"scripts": { | ||
"build": "tsc" | ||
}, | ||
"dependencies": { | ||
"@pulumi/pulumi": "^3.0.0", | ||
"@pulumi/aws": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^8.0.0" | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
provider/test-programs/disappearing-bucket-object/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"outDir": "bin", | ||
"target": "es2016", | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"sourceMap": true, | ||
"experimentalDecorators": true, | ||
"pretty": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitReturns": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"strictNullChecks": true | ||
}, | ||
"files": [ | ||
"index.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters