Files
Lucas Bajolet fd24ef7cf5 command: move command logic to using schedulers
In order to be able to change how templates are processed later on, we
move the logic that processes templates to a new abstraction: Scheduler.

Right now, one implementation of Scheduler exists: sequential. This is
essentially the same approach as what we have now embedded in the
configs, but is now moved to this structure, so we can change it later.
2023-10-11 14:28:27 -04:00

27 lines
613 B
Go

package json
import (
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/packer/packer"
)
type JSONSequentialScheduler struct {
config *packer.Core
}
func NewScheduler(config *packer.Core) *JSONSequentialScheduler {
return &JSONSequentialScheduler{
config: config,
}
}
// EvaluateDataSources is a noop in JSON as data sources are not supported in this mode.
func (s *JSONSequentialScheduler) ExecuteDataSources(bool) hcl.Diagnostics {
return nil
}
// In a JSON template, there are no HCL files, so this is always nil.
func (s *JSONSequentialScheduler) FileMap() map[string]*hcl.File {
return nil
}