mirror of https://github.com/pulumi/pulumi.git
29 lines
564 B
Go
29 lines
564 B
Go
// 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")
|
|
|
|
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),
|
|
})
|
|
}
|