From 6fbd664b66b4690318f39705334ef3115ed14021 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 14 Oct 2019 16:12:09 +0200 Subject: [PATCH] builder.vagrant: simplify communicator.Config field --- builder/vagrant/builder.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/builder/vagrant/builder.go b/builder/vagrant/builder.go index 69c6fb3cf..72d8ac490 100644 --- a/builder/vagrant/builder.go +++ b/builder/vagrant/builder.go @@ -27,17 +27,14 @@ type Builder struct { runner multistep.Runner } -type SSHConfig struct { - Comm communicator.Config `mapstructure:",squash"` -} - type Config struct { common.PackerConfig `mapstructure:",squash"` common.HTTPConfig `mapstructure:",squash"` common.ISOConfig `mapstructure:",squash"` common.FloppyConfig `mapstructure:",squash"` bootcommand.BootConfig `mapstructure:",squash"` - SSHConfig `mapstructure:",squash"` + + Comm communicator.Config `mapstructure:",squash"` // The directory to create that will contain your output box. We always // create this directory and run from inside of it to prevent Vagrant init // collisions. If unset, it will be set to packer- plus your buildname. @@ -281,9 +278,9 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack b.config.GlobalID, }, &communicator.StepConnect{ - Config: &b.config.SSHConfig.Comm, + Config: &b.config.Comm, Host: CommHost(), - SSHConfig: b.config.SSHConfig.Comm.SSHConfigFunc(), + SSHConfig: b.config.Comm.SSHConfigFunc(), }, new(common.StepProvision), &StepPackage{