refactor ShutdownConfig into a single struct
This commit is contained in:
parent
24fad50b00
commit
926c8bbaa6
|
@ -16,6 +16,7 @@ import (
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
powershell "github.com/hashicorp/packer/common/powershell"
|
powershell "github.com/hashicorp/packer/common/powershell"
|
||||||
"github.com/hashicorp/packer/common/powershell/hyperv"
|
"github.com/hashicorp/packer/common/powershell/hyperv"
|
||||||
|
"github.com/hashicorp/packer/common/shutdowncommand"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
|
@ -59,7 +60,7 @@ type Config struct {
|
||||||
bootcommand.BootConfig `mapstructure:",squash"`
|
bootcommand.BootConfig `mapstructure:",squash"`
|
||||||
hypervcommon.OutputConfig `mapstructure:",squash"`
|
hypervcommon.OutputConfig `mapstructure:",squash"`
|
||||||
hypervcommon.SSHConfig `mapstructure:",squash"`
|
hypervcommon.SSHConfig `mapstructure:",squash"`
|
||||||
hypervcommon.ShutdownConfig `mapstructure:",squash"`
|
shutdowncommand.ShutdownConfig `mapstructure:",squash"`
|
||||||
// The size, in megabytes, of the hard disk to create
|
// The size, in megabytes, of the hard disk to create
|
||||||
// for the VM. By default, this is 40 GB.
|
// for the VM. By default, this is 40 GB.
|
||||||
DiskSize uint `mapstructure:"disk_size" required:"false"`
|
DiskSize uint `mapstructure:"disk_size" required:"false"`
|
||||||
|
|
|
@ -15,6 +15,7 @@ import (
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
powershell "github.com/hashicorp/packer/common/powershell"
|
powershell "github.com/hashicorp/packer/common/powershell"
|
||||||
"github.com/hashicorp/packer/common/powershell/hyperv"
|
"github.com/hashicorp/packer/common/powershell/hyperv"
|
||||||
|
"github.com/hashicorp/packer/common/shutdowncommand"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
|
@ -49,7 +50,7 @@ type Config struct {
|
||||||
bootcommand.BootConfig `mapstructure:",squash"`
|
bootcommand.BootConfig `mapstructure:",squash"`
|
||||||
hypervcommon.OutputConfig `mapstructure:",squash"`
|
hypervcommon.OutputConfig `mapstructure:",squash"`
|
||||||
hypervcommon.SSHConfig `mapstructure:",squash"`
|
hypervcommon.SSHConfig `mapstructure:",squash"`
|
||||||
hypervcommon.ShutdownConfig `mapstructure:",squash"`
|
shutdowncommand.ShutdownConfig `mapstructure:",squash"`
|
||||||
// The amount, in megabytes, of RAM to assign to the
|
// The amount, in megabytes, of RAM to assign to the
|
||||||
// VM. By default, this is 1 GB.
|
// VM. By default, this is 1 GB.
|
||||||
RamSize uint `mapstructure:"memory" required:"false"`
|
RamSize uint `mapstructure:"memory" required:"false"`
|
||||||
|
|
|
@ -1,41 +0,0 @@
|
||||||
//go:generate struct-markdown
|
|
||||||
|
|
||||||
package common
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
|
||||||
)
|
|
||||||
|
|
||||||
// ShutdownConfig contains the configuration for VM shutdown.
|
|
||||||
type ShutdownConfig struct {
|
|
||||||
// The command to use to gracefully shut down the
|
|
||||||
// machine once all the provisioning is done. By default this is an empty
|
|
||||||
// string, which tells Packer to just forcefully shut down the machine.
|
|
||||||
ShutdownCommand string `mapstructure:"shutdown_command" required:"false"`
|
|
||||||
// The amount of time to wait after executing the
|
|
||||||
// shutdown_command for the virtual machine to actually shut down. If it
|
|
||||||
// doesn't shut down in this time, it is an error. By default, the timeout is
|
|
||||||
// "5m", or five minutes.
|
|
||||||
RawShutdownTimeout string `mapstructure:"shutdown_timeout" required:"false"`
|
|
||||||
|
|
||||||
ShutdownTimeout time.Duration ``
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prepare sets default values to the VM shutdown configuration.
|
|
||||||
func (c *ShutdownConfig) Prepare(ctx *interpolate.Context) []error {
|
|
||||||
if c.RawShutdownTimeout == "" {
|
|
||||||
c.RawShutdownTimeout = "5m"
|
|
||||||
}
|
|
||||||
|
|
||||||
var errs []error
|
|
||||||
var err error
|
|
||||||
c.ShutdownTimeout, err = time.ParseDuration(c.RawShutdownTimeout)
|
|
||||||
if err != nil {
|
|
||||||
errs = append(errs, fmt.Errorf("Failed parsing shutdown_timeout: %s", err))
|
|
||||||
}
|
|
||||||
|
|
||||||
return errs
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
package common
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
func testShutdownConfig() *ShutdownConfig {
|
|
||||||
return &ShutdownConfig{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestShutdownConfigPrepare_ShutdownCommand(t *testing.T) {
|
|
||||||
var c *ShutdownConfig
|
|
||||||
var errs []error
|
|
||||||
|
|
||||||
c = testShutdownConfig()
|
|
||||||
errs = c.Prepare(testConfigTemplate(t))
|
|
||||||
if len(errs) > 0 {
|
|
||||||
t.Fatalf("err: %#v", errs)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestShutdownConfigPrepare_ShutdownTimeout(t *testing.T) {
|
|
||||||
var c *ShutdownConfig
|
|
||||||
var errs []error
|
|
||||||
|
|
||||||
// Test with a bad value
|
|
||||||
c = testShutdownConfig()
|
|
||||||
c.RawShutdownTimeout = "this is not good"
|
|
||||||
errs = c.Prepare(testConfigTemplate(t))
|
|
||||||
if len(errs) == 0 {
|
|
||||||
t.Fatalf("should have error")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test with a good one
|
|
||||||
c = testShutdownConfig()
|
|
||||||
c.RawShutdownTimeout = "5s"
|
|
||||||
errs = c.Prepare(testConfigTemplate(t))
|
|
||||||
if len(errs) > 0 {
|
|
||||||
t.Fatalf("err: %#v", errs)
|
|
||||||
}
|
|
||||||
if c.ShutdownTimeout != 5*time.Second {
|
|
||||||
t.Fatalf("bad: %s", c.ShutdownTimeout)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -10,6 +10,7 @@ import (
|
||||||
parallelscommon "github.com/hashicorp/packer/builder/parallels/common"
|
parallelscommon "github.com/hashicorp/packer/builder/parallels/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/shutdowncommand"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
|
@ -35,7 +36,7 @@ type Config struct {
|
||||||
parallelscommon.PrlctlConfig `mapstructure:",squash"`
|
parallelscommon.PrlctlConfig `mapstructure:",squash"`
|
||||||
parallelscommon.PrlctlPostConfig `mapstructure:",squash"`
|
parallelscommon.PrlctlPostConfig `mapstructure:",squash"`
|
||||||
parallelscommon.PrlctlVersionConfig `mapstructure:",squash"`
|
parallelscommon.PrlctlVersionConfig `mapstructure:",squash"`
|
||||||
parallelscommon.ShutdownConfig `mapstructure:",squash"`
|
shutdowncommand.ShutdownConfig `mapstructure:",squash"`
|
||||||
parallelscommon.SSHConfig `mapstructure:",squash"`
|
parallelscommon.SSHConfig `mapstructure:",squash"`
|
||||||
parallelscommon.ToolsConfig `mapstructure:",squash"`
|
parallelscommon.ToolsConfig `mapstructure:",squash"`
|
||||||
// The size, in megabytes, of the hard disk to create
|
// The size, in megabytes, of the hard disk to create
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
parallelscommon "github.com/hashicorp/packer/builder/parallels/common"
|
parallelscommon "github.com/hashicorp/packer/builder/parallels/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/shutdowncommand"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/template/interpolate"
|
||||||
|
@ -23,7 +24,7 @@ type Config struct {
|
||||||
parallelscommon.PrlctlPostConfig `mapstructure:",squash"`
|
parallelscommon.PrlctlPostConfig `mapstructure:",squash"`
|
||||||
parallelscommon.PrlctlVersionConfig `mapstructure:",squash"`
|
parallelscommon.PrlctlVersionConfig `mapstructure:",squash"`
|
||||||
parallelscommon.SSHConfig `mapstructure:",squash"`
|
parallelscommon.SSHConfig `mapstructure:",squash"`
|
||||||
parallelscommon.ShutdownConfig `mapstructure:",squash"`
|
shutdowncommand.ShutdownConfig `mapstructure:",squash"`
|
||||||
bootcommand.BootConfig `mapstructure:",squash"`
|
bootcommand.BootConfig `mapstructure:",squash"`
|
||||||
parallelscommon.ToolsConfig `mapstructure:",squash"`
|
parallelscommon.ToolsConfig `mapstructure:",squash"`
|
||||||
// The path to a PVM directory that acts as the source
|
// The path to a PVM directory that acts as the source
|
||||||
|
|
|
@ -15,6 +15,7 @@ import (
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/shutdowncommand"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
|
@ -95,6 +96,7 @@ type Config struct {
|
||||||
common.HTTPConfig `mapstructure:",squash"`
|
common.HTTPConfig `mapstructure:",squash"`
|
||||||
common.ISOConfig `mapstructure:",squash"`
|
common.ISOConfig `mapstructure:",squash"`
|
||||||
bootcommand.VNCConfig `mapstructure:",squash"`
|
bootcommand.VNCConfig `mapstructure:",squash"`
|
||||||
|
shutdowncommand.ShutdownConfig `mapstructure:",squash"`
|
||||||
Comm communicator.Config `mapstructure:",squash"`
|
Comm communicator.Config `mapstructure:",squash"`
|
||||||
common.FloppyConfig `mapstructure:",squash"`
|
common.FloppyConfig `mapstructure:",squash"`
|
||||||
// Use iso from provided url. Qemu must support
|
// Use iso from provided url. Qemu must support
|
||||||
|
@ -268,16 +270,6 @@ type Config struct {
|
||||||
// some platforms. For example qemu-kvm, or qemu-system-i386 may be a
|
// some platforms. For example qemu-kvm, or qemu-system-i386 may be a
|
||||||
// better choice for some systems.
|
// better choice for some systems.
|
||||||
QemuBinary string `mapstructure:"qemu_binary" required:"false"`
|
QemuBinary string `mapstructure:"qemu_binary" required:"false"`
|
||||||
// The command to use to gracefully shut down the
|
|
||||||
// machine once all the provisioning is done. By default this is an empty
|
|
||||||
// string, which tells Packer to just forcefully shut down the machine unless a
|
|
||||||
// shutdown command takes place inside script so this may safely be omitted. It
|
|
||||||
// is important to add a shutdown_command. By default Packer halts the virtual
|
|
||||||
// machine and the file system may not be sync'd. Thus, changes made in a
|
|
||||||
// provisioner might not be saved. If one or more scripts require a reboot it is
|
|
||||||
// suggested to leave this blank since reboots may fail and specify the final
|
|
||||||
// shutdown command in your last script.
|
|
||||||
ShutdownCommand string `mapstructure:"shutdown_command" required:"false"`
|
|
||||||
// The minimum and
|
// The minimum and
|
||||||
// maximum port to use for the SSH port on the host machine which is forwarded
|
// maximum port to use for the SSH port on the host machine which is forwarded
|
||||||
// to the SSH port on the guest machine. Because Packer often runs in parallel,
|
// to the SSH port on the guest machine. Because Packer often runs in parallel,
|
||||||
|
@ -312,13 +304,7 @@ type Config struct {
|
||||||
|
|
||||||
// TODO(mitchellh): deprecate
|
// TODO(mitchellh): deprecate
|
||||||
RunOnce bool `mapstructure:"run_once"`
|
RunOnce bool `mapstructure:"run_once"`
|
||||||
// The amount of time to wait after executing the
|
|
||||||
// shutdown_command for the virtual machine to actually shut down. If it
|
|
||||||
// doesn't shut down in this time, it is an error. By default, the timeout is
|
|
||||||
// 5m or five minutes.
|
|
||||||
RawShutdownTimeout string `mapstructure:"shutdown_timeout" required:"false"`
|
|
||||||
|
|
||||||
shutdownTimeout time.Duration ``
|
|
||||||
ctx interpolate.Context
|
ctx interpolate.Context
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,6 +326,8 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
|
||||||
var errs *packer.MultiError
|
var errs *packer.MultiError
|
||||||
warnings := make([]string, 0)
|
warnings := make([]string, 0)
|
||||||
|
|
||||||
|
errs = packer.MultiErrorAppend(errs, b.config.ShutdownConfig.Prepare(&b.config.ctx)...)
|
||||||
|
|
||||||
if b.config.DiskSize == 0 {
|
if b.config.DiskSize == 0 {
|
||||||
b.config.DiskSize = 40960
|
b.config.DiskSize = 40960
|
||||||
}
|
}
|
||||||
|
@ -508,16 +496,6 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if b.config.RawShutdownTimeout == "" {
|
|
||||||
b.config.RawShutdownTimeout = "5m"
|
|
||||||
}
|
|
||||||
|
|
||||||
b.config.shutdownTimeout, err = time.ParseDuration(b.config.RawShutdownTimeout)
|
|
||||||
if err != nil {
|
|
||||||
errs = packer.MultiErrorAppend(
|
|
||||||
errs, fmt.Errorf("Failed parsing shutdown_timeout: %s", err))
|
|
||||||
}
|
|
||||||
|
|
||||||
if b.config.SSHHostPortMin > b.config.SSHHostPortMax {
|
if b.config.SSHHostPortMin > b.config.SSHHostPortMax {
|
||||||
errs = packer.MultiErrorAppend(
|
errs = packer.MultiErrorAppend(
|
||||||
errs, errors.New("ssh_host_port_min must be less than ssh_host_port_max"))
|
errs, errors.New("ssh_host_port_min must be less than ssh_host_port_max"))
|
||||||
|
|
|
@ -33,7 +33,7 @@ func (s *stepShutdown) Run(ctx context.Context, state multistep.StateBag) multis
|
||||||
cancelCh := make(chan struct{}, 1)
|
cancelCh := make(chan struct{}, 1)
|
||||||
go func() {
|
go func() {
|
||||||
defer close(cancelCh)
|
defer close(cancelCh)
|
||||||
<-time.After(config.shutdownTimeout)
|
<-time.After(config.ShutdownTimeout)
|
||||||
}()
|
}()
|
||||||
ui.Say("Waiting for shutdown...")
|
ui.Say("Waiting for shutdown...")
|
||||||
if ok := driver.WaitForShutdown(cancelCh); ok {
|
if ok := driver.WaitForShutdown(cancelCh); ok {
|
||||||
|
@ -63,10 +63,10 @@ func (s *stepShutdown) Run(ctx context.Context, state multistep.StateBag) multis
|
||||||
cancelCh := make(chan struct{}, 1)
|
cancelCh := make(chan struct{}, 1)
|
||||||
go func() {
|
go func() {
|
||||||
defer close(cancelCh)
|
defer close(cancelCh)
|
||||||
<-time.After(config.shutdownTimeout)
|
<-time.After(config.ShutdownTimeout)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
log.Printf("Waiting max %s for shutdown to complete", config.shutdownTimeout)
|
log.Printf("Waiting max %s for shutdown to complete", config.ShutdownTimeout)
|
||||||
if ok := driver.WaitForShutdown(cancelCh); !ok {
|
if ok := driver.WaitForShutdown(cancelCh); !ok {
|
||||||
err := errors.New("Timeout while waiting for machine to shut down.")
|
err := errors.New("Timeout while waiting for machine to shut down.")
|
||||||
state.Put("error", err)
|
state.Put("error", err)
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
//go:generate struct-markdown
|
|
||||||
|
|
||||||
package common
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
|
||||||
)
|
|
||||||
|
|
||||||
type ShutdownConfig struct {
|
|
||||||
// The command to use to gracefully shut down the
|
|
||||||
// machine once all the provisioning is done. By default this is an empty
|
|
||||||
// string, which tells Packer to just forcefully shut down the machine.
|
|
||||||
ShutdownCommand string `mapstructure:"shutdown_command" required:"false"`
|
|
||||||
// The amount of time to wait after executing the
|
|
||||||
// shutdown_command for the virtual machine to actually shut down. If it
|
|
||||||
// doesn't shut down in this time, it is an error. By default, the timeout is
|
|
||||||
// 5m or five minutes.
|
|
||||||
RawShutdownTimeout string `mapstructure:"shutdown_timeout" required:"false"`
|
|
||||||
|
|
||||||
ShutdownTimeout time.Duration ``
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *ShutdownConfig) Prepare(ctx *interpolate.Context) []error {
|
|
||||||
if c.RawShutdownTimeout == "" {
|
|
||||||
c.RawShutdownTimeout = "5m"
|
|
||||||
}
|
|
||||||
|
|
||||||
var errs []error
|
|
||||||
var err error
|
|
||||||
c.ShutdownTimeout, err = time.ParseDuration(c.RawShutdownTimeout)
|
|
||||||
if err != nil {
|
|
||||||
errs = append(errs, fmt.Errorf("Failed parsing shutdown_timeout: %s", err))
|
|
||||||
}
|
|
||||||
|
|
||||||
return errs
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
package common
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
func testShutdownConfig() *ShutdownConfig {
|
|
||||||
return &ShutdownConfig{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestShutdownConfigPrepare_ShutdownCommand(t *testing.T) {
|
|
||||||
var c *ShutdownConfig
|
|
||||||
var errs []error
|
|
||||||
|
|
||||||
c = testShutdownConfig()
|
|
||||||
errs = c.Prepare(testConfigTemplate(t))
|
|
||||||
if len(errs) > 0 {
|
|
||||||
t.Fatalf("err: %#v", errs)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestShutdownConfigPrepare_ShutdownTimeout(t *testing.T) {
|
|
||||||
var c *ShutdownConfig
|
|
||||||
var errs []error
|
|
||||||
|
|
||||||
// Test with a bad value
|
|
||||||
c = testShutdownConfig()
|
|
||||||
c.RawShutdownTimeout = "this is not good"
|
|
||||||
errs = c.Prepare(testConfigTemplate(t))
|
|
||||||
if len(errs) == 0 {
|
|
||||||
t.Fatalf("should have error")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test with a good one
|
|
||||||
c = testShutdownConfig()
|
|
||||||
c.RawShutdownTimeout = "5s"
|
|
||||||
errs = c.Prepare(testConfigTemplate(t))
|
|
||||||
if len(errs) > 0 {
|
|
||||||
t.Fatalf("err: %#v", errs)
|
|
||||||
}
|
|
||||||
if c.ShutdownTimeout != 5*time.Second {
|
|
||||||
t.Fatalf("bad: %s", c.ShutdownTimeout)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -11,6 +11,7 @@ import (
|
||||||
vmwcommon "github.com/hashicorp/packer/builder/vmware/common"
|
vmwcommon "github.com/hashicorp/packer/builder/vmware/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/shutdowncommand"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/template/interpolate"
|
||||||
|
@ -26,7 +27,7 @@ type Config struct {
|
||||||
vmwcommon.HWConfig `mapstructure:",squash"`
|
vmwcommon.HWConfig `mapstructure:",squash"`
|
||||||
vmwcommon.OutputConfig `mapstructure:",squash"`
|
vmwcommon.OutputConfig `mapstructure:",squash"`
|
||||||
vmwcommon.RunConfig `mapstructure:",squash"`
|
vmwcommon.RunConfig `mapstructure:",squash"`
|
||||||
vmwcommon.ShutdownConfig `mapstructure:",squash"`
|
shutdowncommand.ShutdownConfig `mapstructure:",squash"`
|
||||||
vmwcommon.SSHConfig `mapstructure:",squash"`
|
vmwcommon.SSHConfig `mapstructure:",squash"`
|
||||||
vmwcommon.ToolsConfig `mapstructure:",squash"`
|
vmwcommon.ToolsConfig `mapstructure:",squash"`
|
||||||
vmwcommon.VMXConfig `mapstructure:",squash"`
|
vmwcommon.VMXConfig `mapstructure:",squash"`
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
vmwcommon "github.com/hashicorp/packer/builder/vmware/common"
|
vmwcommon "github.com/hashicorp/packer/builder/vmware/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/shutdowncommand"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/template/interpolate"
|
||||||
|
@ -23,7 +24,7 @@ type Config struct {
|
||||||
vmwcommon.DriverConfig `mapstructure:",squash"`
|
vmwcommon.DriverConfig `mapstructure:",squash"`
|
||||||
vmwcommon.OutputConfig `mapstructure:",squash"`
|
vmwcommon.OutputConfig `mapstructure:",squash"`
|
||||||
vmwcommon.RunConfig `mapstructure:",squash"`
|
vmwcommon.RunConfig `mapstructure:",squash"`
|
||||||
vmwcommon.ShutdownConfig `mapstructure:",squash"`
|
shutdowncommand.ShutdownConfig `mapstructure:",squash"`
|
||||||
vmwcommon.SSHConfig `mapstructure:",squash"`
|
vmwcommon.SSHConfig `mapstructure:",squash"`
|
||||||
vmwcommon.ToolsConfig `mapstructure:",squash"`
|
vmwcommon.ToolsConfig `mapstructure:",squash"`
|
||||||
vmwcommon.VMXConfig `mapstructure:",squash"`
|
vmwcommon.VMXConfig `mapstructure:",squash"`
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
//go:generate struct-markdown
|
package shutdowncommand
|
||||||
|
|
||||||
package common
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
|
@ -1,4 +1,4 @@
|
||||||
package common
|
package shutdowncommand
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
Loading…
Reference in New Issue