Skip to content

Commit

Permalink
Fix panic with checking computed env values (#425)
Browse files Browse the repository at this point in the history
Fixes #423
  • Loading branch information
seanyeh authored Oct 9, 2024
1 parent d495c89 commit 27da14a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

### Bug Fixes

- Fix panic when using computed values in environment properties [#423](https://github.com/pulumi/pulumi-pulumiservice/issues/423)

### Miscellaneous
6 changes: 4 additions & 2 deletions provider/pkg/provider/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,14 @@ func (st *PulumiServiceEnvironmentResource) Check(req *pulumirpc.CheckRequest) (

var failures []*pulumirpc.CheckFailure
for _, p := range []resource.PropertyKey{"organization", "project", "name", "yaml"} {
if !inputMap[(p)].HasValue() {
input := inputMap[(p)]

if !input.HasValue() {
failures = append(failures, &pulumirpc.CheckFailure{
Reason: fmt.Sprintf("missing required property '%s'", p),
Property: string(p),
})
} else if p != "yaml" && strings.Contains(inputMap[(p)].StringValue(), "/") {
} else if p != "yaml" && !input.IsComputed() && strings.Contains(input.StringValue(), "/") {
failures = append(failures, &pulumirpc.CheckFailure{
Reason: fmt.Sprintf("'%s' property contains `/` illegal character", p),
Property: string(p),
Expand Down

0 comments on commit 27da14a

Please sign in to comment.