Output key and correct stack on keynotfound (#5740)
* Output key and correct stack on keynotfound Co-authored-by: Mikhail Shilkov <github@mikhail.io>
This commit is contained in:
parent
bfe4969f35
commit
89daaa2ff1
|
@ -36,6 +36,9 @@ CHANGELOG
|
|||
- .NET: Report plugin install errors during `pulumi new`.
|
||||
[#5760](https://github.com/pulumi/pulumi/pull/5760)
|
||||
|
||||
- Correct error message on KeyNotFoundException against StackReference.
|
||||
[#5740](https://github.com/pulumi/pulumi/pull/5740)
|
||||
|
||||
## 2.13.2 (2020-11-06)
|
||||
|
||||
- Fix a bug that was causing errors when (de)serializing custom resources.
|
||||
|
|
|
@ -72,11 +72,12 @@ namespace Pulumi
|
|||
public Output<object> RequireOutput(Input<string> name)
|
||||
{
|
||||
var inputs = (Input<ImmutableDictionary<string, object>>)this.Outputs;
|
||||
var value = Output.Tuple(name, inputs).Apply(v =>
|
||||
v.Item2.TryGetValue(v.Item1, out var result)
|
||||
var stackName = (Input<string>)this.Name;
|
||||
var value = Output.Tuple(name, stackName, inputs).Apply(v =>
|
||||
v.Item3.TryGetValue(v.Item1, out var result)
|
||||
? result
|
||||
: throw new KeyNotFoundException(
|
||||
$"Required output '{name}' does not exist on stack '{Deployment.Instance.StackName}'."));
|
||||
$"Required output '{v.Item1}' does not exist on stack '{v.Item2}'."));
|
||||
|
||||
return value.WithIsSecret(IsSecretOutputName(name));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue