Prevent panic when using pulumi import
with local backend (#5906)
Fixes: #5876
This commit is contained in:
parent
cba68b0874
commit
3994fa8c22
|
@ -5,6 +5,9 @@ CHANGELOG
|
||||||
|
|
||||||
- Re-apply fix for running multiple `pulumi` processes concurrently.
|
- Re-apply fix for running multiple `pulumi` processes concurrently.
|
||||||
[#5893](https://github.com/pulumi/pulumi/issues/5893)
|
[#5893](https://github.com/pulumi/pulumi/issues/5893)
|
||||||
|
|
||||||
|
- [cli] Prevent a panic when using `pulumi import` with local filesystems
|
||||||
|
[#5906](https://github.com/pulumi/pulumi/issues/5906)
|
||||||
|
|
||||||
## 2.15.4 (2020-12-08)
|
## 2.15.4 (2020-12-08)
|
||||||
|
|
||||||
|
|
|
@ -129,17 +129,19 @@ func (i *importer) wait(ctx context.Context, token completionToken) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *importer) registerExistingResources(ctx context.Context) bool {
|
func (i *importer) registerExistingResources(ctx context.Context) bool {
|
||||||
// Issue same steps per existing resource to make sure that they are recorded in the snapshot.
|
if i != nil && i.deployment != nil && i.deployment.prev != nil {
|
||||||
// We issue these steps serially s.t. the resources remain in the order in which they appear in the state.
|
// Issue same steps per existing resource to make sure that they are recorded in the snapshot.
|
||||||
for _, r := range i.deployment.prev.Resources {
|
// We issue these steps serially s.t. the resources remain in the order in which they appear in the state.
|
||||||
if r.Delete {
|
for _, r := range i.deployment.prev.Resources {
|
||||||
continue
|
if r.Delete {
|
||||||
}
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
new := *r
|
new := *r
|
||||||
new.ID = ""
|
new.ID = ""
|
||||||
if !i.executeSerial(ctx, NewSameStep(i.deployment, noopEvent(0), r, &new)) {
|
if !i.executeSerial(ctx, NewSameStep(i.deployment, noopEvent(0), r, &new)) {
|
||||||
return false
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in a new issue