Ensure the CLI doesn't panic when trying to build a graph for a stack with no snapshot (#5678)
Fixes: #4952
This commit is contained in:
parent
4d96994fd1
commit
a42bafcf5c
|
@ -11,6 +11,9 @@ CHANGELOG
|
|||
|
||||
- [cli] Ensure that the CLI doesn't panic when using pulumi watch and using ComponentResources with non-standard naming
|
||||
[#5675](https://github.com/pulumi/pulumi/pull/5675)
|
||||
|
||||
- [cli] Ensure that the CLI doesn't panic when trying to assemble a graph on a stack that has no snapshot available
|
||||
[#5678](https://github.com/pulumi/pulumi/pull/5678)
|
||||
|
||||
## 2.12.1 (2020-10-23)
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
|
@ -65,6 +66,11 @@ func newStackGraphCmd() *cobra.Command {
|
|||
return err
|
||||
}
|
||||
|
||||
// This will prevent a panic when trying to assemble a dependencyGraph when no snapshot is found
|
||||
if snap == nil {
|
||||
return errors.Errorf("unable to find snapshot for stack %q", stackName)
|
||||
}
|
||||
|
||||
dg := makeDependencyGraph(snap)
|
||||
file, err := os.Create(args[0])
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue