fix unknown status for secrets wrapping unknowns (#4377)

* fix unknown status for secrets wrapping unknowns

* changelog

* add test for secret computed values
This commit is contained in:
Evan Boyle 2020-04-13 14:47:08 -07:00 committed by GitHub
parent 4bbddafe6c
commit 9d2f40b686
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 0 deletions

View file

@ -62,6 +62,9 @@ CHANGELOG
- Fix Go SDK stack reference helpers to handle nil values
[#4370](https://github.com/pulumi/pulumi/pull/4370)
- Fix propagation of unknown status for secrets
[#4377](https://github.com/pulumi/pulumi/pull/4377)
## 1.14.0 (2020-04-01)
- Fix error related to side-by-side versions of `@pulumi/pulumi`.
[#4235](https://github.com/pulumi/pulumi/pull/4235)

View file

@ -326,6 +326,8 @@ func (v PropertyValue) ContainsUnknowns() bool {
}
} else if v.IsObject() {
return v.ObjectValue().ContainsUnknowns()
} else if v.IsSecret() {
return v.SecretValue().Element.ContainsUnknowns()
}
return false
}

View file

@ -159,3 +159,14 @@ func TestCopy(t *testing.T) {
src["c"] = NewNumberProperty(99.99)
assert.Equal(t, 2, len(dst))
}
func TestSecretUnknown(t *testing.T) {
o := NewOutputProperty(Output{Element: NewNumberProperty(46)})
so := MakeSecret(o)
assert.True(t, o.ContainsUnknowns())
assert.True(t, so.ContainsUnknowns())
c := NewComputedProperty(Computed{Element: NewStringProperty("X")})
co := MakeSecret(so)
assert.True(t, c.ContainsUnknowns())
assert.True(t, co.ContainsUnknowns())
}