Ensure CLI doesn't panic when using pulumi watch and ComponentResources (#5675)
This commit is contained in:
parent
f1f6a126bc
commit
056c82cd09
|
@ -5,8 +5,12 @@ CHANGELOG
|
|||
|
||||
- Add internal scaffolding for using cross-language components from Go.
|
||||
[#5558](https://github.com/pulumi/pulumi/pull/5558)
|
||||
|
||||
- Support python 3.9.
|
||||
[#5669](https://github.com/pulumi/pulumi/pull/5669)
|
||||
|
||||
- [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)
|
||||
|
||||
## 2.12.1 (2020-10-23)
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ package operations
|
|||
|
||||
import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/pulumi/pulumi/sdk/v2/go/common/resource"
|
||||
|
@ -249,6 +250,12 @@ func (ops *resourceOperations) getOperationsProvider() (Provider, error) {
|
|||
if ops.resource == nil || ops.resource.State == nil {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
tokenSeparators := strings.Count(ops.resource.State.Type.String(), ":")
|
||||
if tokenSeparators != 2 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
switch ops.resource.State.Type.Package() {
|
||||
case "cloud":
|
||||
return CloudOperationsProvider(ops.config, ops.resource)
|
||||
|
|
Loading…
Reference in a new issue