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:
parent
4bbddafe6c
commit
9d2f40b686
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue