pulumi/pkg/engine/destroy.go
Pat Gavlin a23b10a9bf
Update the copyright end date to 2018. (#1068)
Just what it says on the tin.
2018-03-21 12:43:21 -07:00

28 lines
630 B
Go

// Copyright 2018, 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()
emitter := makeEventEmitter(events, update)
return deployLatest(info, deployOptions{
UpdateOptions: opts,
Destroy: true,
Events: emitter,
Diag: newEventSink(emitter),
})
}