Files
Packer-Cn/command/scheduler.go
Lucas Bajolet 18a25a1a5f command: migrate hcl2_upgrade to schedulers
As the last command that relies on the deprecated interfaces for
interacting with a template, we move hcl2_upgrade to the schedulers, at
least for the part that prepares the template for translation.
2023-10-11 14:28:27 -04:00

26 lines
525 B
Go

package command
import (
"context"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
"github.com/hashicorp/packer/packer"
)
type Scheduler interface {
Build(*BuildArgs) int
Validate(*ValidateArgs) int
Inspect(*InspectArgs) int
Console(*ConsoleArgs) int
HCL2Upgrade(*HCL2UpgradeArgs) int
}
// NewScheduler returns a new scheduler for running commands with.
func NewScheduler(
cfg packer.Handler,
ui packersdk.Ui,
context context.Context,
) Scheduler {
return NewSequentialScheduler(cfg, ui, context)
}