Ensure CLI doesn't panic when using pulumi watch and ComponentResources (#5675)

This commit is contained in:
Paul Stack 2020-11-04 01:14:43 +00:00 committed by GitHub
parent f1f6a126bc
commit 056c82cd09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -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)

View file

@ -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)