pulumi/pkg/engine/destroy.go

29 lines
564 B
Go
Raw Normal View History

// Copyright 2017, Pulumi Corporation. All rights reserved.
package engine
import (
"github.com/pulumi/pulumi/pkg/util/contract"
)
func Destroy(update Update, events chan<- Event, opts UpdateOptions) (ResourceChanges, error) {
contract.Require(update != nil, "update")
2017-10-23 00:52:00 +02:00
defer func() { events <- cancelEvent() }()
info, err := planContextFromUpdate(update)
if err != nil {
return nil, err
}
defer info.Close()
return deployLatest(info, deployOptions{
UpdateOptions: opts,
Destroy: true,
Events: events,
Diag: newEventSink(events),
})
}