Skip to content

Commit 8b24235

Browse files
add debug config
1 parent 393899e commit 8b24235

File tree

7 files changed

+16
-4
lines changed

7 files changed

+16
-4
lines changed

examples/dotnet/provider-defang.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88
<ItemGroup>
99
<PackageReference Include="Pulumi" Version="3.*" />
10-
<PackageReference Include="DefangLabs.Defang" Version="1.1.0-beta.12" />
10+
<PackageReference Include="DefangLabs.Defang" Version="1.2.0-alpha.1745520820+dirty" />
1111
</ItemGroup>
1212

1313
</Project>

examples/go/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ go 1.20
44

55
require (
66
github.com/pulumi/pulumi/sdk/v3 v3.30.0
7-
github.com/DefangLabs/pulumi-defang/sdk v1.1.0-beta.12
7+
github.com/DefangLabs/pulumi-defang/sdk v1.2.0-alpha.1745520820+dirty
88
)

examples/nodejs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"dependencies": {
77
"typescript": "^4.0.0",
88
"@pulumi/pulumi": "^3.0.0",
9-
"@defang-io/pulumi-defang": "1.1.0-beta.12"
9+
"@defang-io/pulumi-defang": "1.2.0-alpha.1745520820+dirty"
1010
}
1111
}

examples/python/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pulumi-defang==1.1.0-beta.12
1+
pulumi-defang==1.2.0-alpha.1745520820+dirty
22
pulumi>=3.0.0,<4.0.0

provider/cmd/pulumi-resource-defang/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ package main
1717
import (
1818
p "github.com/pulumi/pulumi-go-provider"
1919

20+
"github.com/DefangLabs/defang/src/pkg/term"
2021
defang "github.com/DefangLabs/pulumi-defang/provider"
2122
)
2223

2324
// Serve the provider against Pulumi's Provider protocol.
2425
func main() {
26+
term.SetDebug(true)
2527
_ = p.RunProvider(defang.Name, defang.Version, defang.Provider())
2628
}

provider/cmd/pulumi-resource-defang/schema.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
"description": "The cloud provider to use. Can be one of [auto aws gcp digitalocean].",
4343
"default": "auto"
4444
},
45+
"debug": {
46+
"type": "boolean",
47+
"default": false
48+
},
4549
"deploymentMode": {
4650
"type": "string",
4751
"description": "The deployment mode to use. Can be one of [DEVELOPMENT STAGING PRODUCTION].",
@@ -1431,6 +1435,10 @@
14311435
"description": "The cloud provider to use. Can be one of [auto aws gcp digitalocean].",
14321436
"default": "auto"
14331437
},
1438+
"debug": {
1439+
"type": "boolean",
1440+
"default": false
1441+
},
14341442
"deploymentMode": {
14351443
"type": "string",
14361444
"description": "The deployment mode to use. Can be one of [DEVELOPMENT STAGING PRODUCTION].",

provider/provider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ func Provider() p.Provider {
7777

7878
// Define some provider-level configuration.
7979
type Config struct {
80+
Debug bool `json:"debug" pulumi:"debug,omitempty,optional"`
8081
CloudProviderID string `json:"cloudProviderID" pulumi:"cloudProviderID,omitempty,optional"`
8182
DeploymentMode string `json:"deploymentMode" pulumi:"deploymentMode,omitempty,optional"`
8283
}
@@ -94,6 +95,7 @@ func (c *Config) Annotate(ann infer.Annotator) {
9495
&c.DeploymentMode,
9596
fmt.Sprintf("The deployment mode to use. Can be one of [%s].", strings.Join(modes, " ")),
9697
)
98+
ann.SetDefault(&c.Debug, false)
9799
ann.SetDefault(&c.CloudProviderID, "auto")
98100
ann.SetDefault(&c.DeploymentMode, "DEVELOPMENT")
99101
}

0 commit comments

Comments
 (0)