mirror of https://github.com/hashicorp/packer
parent
a68a639a1a
commit
3193f50f17
@ -0,0 +1,25 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/mitchellh/packer/template/interpolate"
|
||||
)
|
||||
|
||||
type ExportConfig struct {
|
||||
Format string `mapstructure:"format"`
|
||||
OVFToolOptions []string `mapstructure:"ovftool_options"`
|
||||
SkipExport bool `mapstructure:"skip_export"`
|
||||
KeepRegistered bool `mapstructure:"keep_registered"`
|
||||
}
|
||||
|
||||
func (c *ExportConfig) Prepare(ctx *interpolate.Context) []error {
|
||||
var errs []error
|
||||
if c.Format != "" {
|
||||
if !(c.Format == "ova" || c.Format == "ovf" || c.Format == "vmx") {
|
||||
errs = append(
|
||||
errs, fmt.Errorf("format must be one of ova, ovf, or vmx"))
|
||||
}
|
||||
}
|
||||
return errs
|
||||
}
|
||||
Loading…
Reference in new issue