pulumi/pkg/engine/destroy.go
Matt Ellis c022db9285 Require environment name on deployment APIs
Deployments always need to be done in the context of some environment,
so let's make the argument explicit instead of it coming in the
property bag
2017-10-02 11:14:27 -07:00

31 lines
593 B
Go

// Copyright 2017, Pulumi Corporation. All rights reserved.
package engine
import (
"github.com/pulumi/pulumi/pkg/tokens"
)
type DestroyOptions struct {
Package string
DryRun bool
Debug bool
Parallel int
Summary bool
}
func (eng *Engine) Destroy(environment string, opts DestroyOptions) error {
info, err := eng.initEnvCmdName(tokens.QName(environment), opts.Package)
if err != nil {
return err
}
return eng.deployLatest(info, deployOptions{
Debug: opts.Debug,
Destroy: true,
DryRun: opts.DryRun,
Parallel: opts.Parallel,
Summary: opts.Summary,
})
}