packer: make Core.Validate public

Since we'll move the initialization code to the schedulers once they're
in the codebase, we make the validation function public.
This commit is contained in:
Lucas Bajolet
2023-10-11 14:28:27 -04:00
parent 9ceee1b1c1
commit d1492ccfce
+2 -2
View File
@@ -152,7 +152,7 @@ func (c *Core) Initialize(_ InitializeOptions) hcl.Diagnostics {
}
func (core *Core) initialize() error {
if err := core.validate(); err != nil {
if err := core.Validate(); err != nil {
return err
}
if err := core.init(); err != nil {
@@ -692,7 +692,7 @@ func (c *Core) FixConfig(opts FixConfigOptions) hcl.Diagnostics {
//
// This will automatically call template.validate() in addition to doing
// richer semantic checks around variables and so on.
func (c *Core) validate() error {
func (c *Core) Validate() error {
// First validate the template in general, we can't do anything else
// unless the template itself is valid.
if err := c.Template.Validate(); err != nil {