Ensure CLI doesn't panic when trying to decrypt a config value in stack history (#5680)

This commit is contained in:
Paul Stack 2020-11-04 17:40:17 +00:00 committed by GitHub
parent 29fe40d5c7
commit 596ee7c668
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,6 @@ import (
"github.com/pulumi/pulumi/sdk/v2/go/common/diag/colors"
"github.com/pulumi/pulumi/sdk/v2/go/common/resource/config"
"github.com/pulumi/pulumi/sdk/v2/go/common/util/cmdutil"
"github.com/pulumi/pulumi/sdk/v2/go/common/util/contract"
)
func newStackHistoryCmd() *cobra.Command {
@ -109,7 +108,9 @@ func displayUpdatesJSON(updates []backend.UpdateInfo, decrypter config.Decrypter
}
if !v.Secure() || (v.Secure() && decrypter != nil) {
value, err := v.Value(decrypter)
contract.AssertNoError(err)
if err != nil {
return err
}
configValue.Value = makeStringRef(value)
if v.Object() {