mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-21 15:31:41 -04:00
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.
27 lines
613 B
Go
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
|
|
}
|