cirruslabs / packer-plugin-tart

Packer builder for Tart VMs
https://developer.hashicorp.com/packer/plugins/builders/tart
Mozilla Public License 2.0
65 stars 16 forks source link

Duplicated code between step_run and step_create_linux_vm #127

Closed torarnv closed 5 months ago

torarnv commented 6 months ago

Looks like the runInstaller part of step_create_linux_vm is duplicating code from step_run. I can clean this up, but want to verify if there are other plans in this area before I dig in. Thanks :)

fkorotkov commented 6 months ago

Indeed! It seems we can reuse code from step_run and just handle FromISO as well. Just add

for _, iso := range config.FromISO {
  runArgs = append(runArgs, fmt.Sprintf("--disk=%s:ro", iso))
}

to step_run and I think we'll be good to go.

A PR will be much appreciated but if you don't have time we can also take it from you.

torarnv commented 6 months ago

Cool, thanks! I'll have a look tomorrow then :)

torarnv commented 6 months ago

Doesn't look like I can assign issues, but consider the issue "assigned" 😄