Skip to content
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.

Commit

Permalink
introduce boot_command to clone builder
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Loeki committed Oct 2, 2019
1 parent 4ec004e commit d5c3a2b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions clone/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
Config: &b.config.RunConfig,
SetOrder: false,
},
&common.StepBootCommand{
Config: &b.config.BootConfig,
Ctx: b.config.ctx,
VMName: b.config.VMName,
},
&common.StepWaitForIp{
Config: &b.config.WaitIpConfig,
},
Expand Down
6 changes: 6 additions & 0 deletions clone/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type Config struct {
common.ConfigParamsConfig `mapstructure:",squash"`

common.RunConfig `mapstructure:",squash"`
common.BootConfig `mapstructure:",squash"`
common.WaitIpConfig `mapstructure:",squash"`
Comm communicator.Config `mapstructure:",squash"`
common.ShutdownConfig `mapstructure:",squash"`
Expand All @@ -34,6 +35,11 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) {
err := config.Decode(c, &config.DecodeOpts{
Interpolate: true,
InterpolateContext: &c.ctx,
InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{
"boot_command",
},
},
}, raws...)
if err != nil {
return nil, nil, err
Expand Down
2 changes: 1 addition & 1 deletion iso/step_boot_command.go → common/step_boot_command.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package iso
package common

import (
"context"
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ require (
)

replace git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999

2 changes: 1 addition & 1 deletion iso/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
Config: &b.config.RunConfig,
SetOrder: true,
},
&StepBootCommand{
&common.StepBootCommand{
Config: &b.config.BootConfig,
Ctx: b.config.ctx,
VMName: b.config.VMName,
Expand Down
2 changes: 1 addition & 1 deletion iso/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type Config struct {
CDRomConfig `mapstructure:",squash"`
FloppyConfig `mapstructure:",squash"`
common.RunConfig `mapstructure:",squash"`
BootConfig `mapstructure:",squash"`
common.BootConfig `mapstructure:",squash"`
common.WaitIpConfig `mapstructure:",squash"`
Comm communicator.Config `mapstructure:",squash"`

Expand Down

0 comments on commit d5c3a2b

Please sign in to comment.