2013-07-14 16:51:20 +09:00
|
|
|
package fix
|
|
|
|
|
|
|
|
// A Fixer is something that can perform a fix operation on a template.
|
|
|
|
type Fixer interface {
|
|
|
|
// Fix takes a raw map structure input, potentially transforms it
|
|
|
|
// in some way, and returns the new, transformed structure. The
|
|
|
|
// Fix method is allowed to mutate the input.
|
|
|
|
Fix(input map[string]interface{}) (map[string]interface{}, error)
|
2013-11-02 12:49:00 +04:00
|
|
|
|
|
|
|
// Synopsis returns a string description of what the fixer actually
|
|
|
|
// does.
|
|
|
|
Synopsis() string
|
2013-07-14 16:51:20 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
// Fixers is the map of all available fixers, by name.
|
|
|
|
var Fixers map[string]Fixer
|
|
|
|
|
2013-12-19 14:44:12 -08:00
|
|
|
// FixerOrder is the default order the fixers should be run.
|
|
|
|
var FixerOrder []string
|
|
|
|
|
2013-07-14 16:51:20 +09:00
|
|
|
func init() {
|
|
|
|
Fixers = map[string]Fixer{
|
2017-09-05 18:09:31 -07:00
|
|
|
"iso-md5": new(FixerISOMD5),
|
|
|
|
"createtime": new(FixerCreateTime),
|
|
|
|
"pp-vagrant-override": new(FixerVagrantPPOverride),
|
|
|
|
"virtualbox-gaattach": new(FixerVirtualBoxGAAttach),
|
|
|
|
"virtualbox-rename": new(FixerVirtualBoxRename),
|
|
|
|
"vmware-rename": new(FixerVMwareRename),
|
|
|
|
"parallels-headless": new(FixerParallelsHeadless),
|
|
|
|
"parallels-deprecations": new(FixerParallelsDeprecations),
|
|
|
|
"sshkeypath": new(FixerSSHKeyPath),
|
|
|
|
"sshdisableagent": new(FixerSSHDisableAgent),
|
|
|
|
"manifest-filename": new(FixerManifestFilename),
|
|
|
|
"amazon-shutdown_behavior": new(FixerAmazonShutdownBehavior),
|
|
|
|
"amazon-enhanced-networking": new(FixerAmazonEnhancedNetworking),
|
2018-02-08 16:47:17 -08:00
|
|
|
"amazon-private-ip": new(FixerAmazonPrivateIP),
|
2017-10-25 09:53:51 -07:00
|
|
|
"docker-email": new(FixerDockerEmail),
|
2017-10-30 00:14:06 +00:00
|
|
|
"powershell-escapes": new(FixerPowerShellEscapes),
|
2013-07-14 16:51:20 +09:00
|
|
|
}
|
2013-12-19 14:44:12 -08:00
|
|
|
|
|
|
|
FixerOrder = []string{
|
|
|
|
"iso-md5",
|
|
|
|
"createtime",
|
|
|
|
"virtualbox-gaattach",
|
2013-12-19 14:54:00 -08:00
|
|
|
"pp-vagrant-override",
|
2013-12-22 16:01:28 -08:00
|
|
|
"virtualbox-rename",
|
2013-12-25 11:13:32 -07:00
|
|
|
"vmware-rename",
|
2015-08-24 15:09:29 +02:00
|
|
|
"parallels-headless",
|
2015-09-18 09:27:50 +02:00
|
|
|
"parallels-deprecations",
|
2015-07-13 07:56:11 -07:00
|
|
|
"sshkeypath",
|
2017-06-19 16:21:33 +02:00
|
|
|
"sshdisableagent",
|
2016-11-21 15:34:50 -08:00
|
|
|
"manifest-filename",
|
2016-12-14 21:50:26 +01:00
|
|
|
"amazon-shutdown_behavior",
|
2017-09-05 18:09:31 -07:00
|
|
|
"amazon-enhanced-networking",
|
2018-02-08 16:47:17 -08:00
|
|
|
"amazon-private-ip",
|
2017-10-25 09:53:51 -07:00
|
|
|
"docker-email",
|
2017-10-30 00:14:06 +00:00
|
|
|
"powershell-escapes",
|
2013-12-19 14:44:12 -08:00
|
|
|
}
|
2013-07-14 16:51:20 +09:00
|
|
|
}
|