packer-cn/fix/fixer.go

76 lines
2.7 KiB
Go
Raw Normal View History

2013-07-14 03:51:20 -04: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)
// Synopsis returns a string description of what the fixer actually
// does.
Synopsis() string
2013-07-14 03:51:20 -04:00
}
// Fixers is the map of all available fixers, by name.
var Fixers map[string]Fixer
2013-12-19 17:44:12 -05:00
// FixerOrder is the default order the fixers should be run.
var FixerOrder []string
2013-07-14 03:51:20 -04:00
func init() {
Fixers = map[string]Fixer{
"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),
"scaleway-access-key": new(FixerScalewayAccessKey),
"manifest-filename": new(FixerManifestFilename),
"amazon-shutdown_behavior": new(FixerAmazonShutdownBehavior),
"amazon-enhanced-networking": new(FixerAmazonEnhancedNetworking),
"amazon-private-ip": new(FixerAmazonPrivateIP),
"amazon-temp-sec-cidrs": new(FixerAmazonTemporarySecurityCIDRs),
"docker-email": new(FixerDockerEmail),
"powershell-escapes": new(FixerPowerShellEscapes),
"hyperv-deprecations": new(FixerHypervDeprecations),
"hyperv-vmxc-typo": new(FixerHypervVmxcTypo),
2019-03-29 18:18:14 -04:00
"hyperv-cpu-and-ram": new(FizerHypervCPUandRAM),
2018-07-16 21:45:47 -04:00
"vmware-compaction": new(FixerVMwareCompaction),
"clean-image-name": new(FixerCleanImageName),
"spot-price-auto-product": new(FixerAmazonSpotPriceProductDeprecation),
2013-07-14 03:51:20 -04:00
}
2013-12-19 17:44:12 -05:00
FixerOrder = []string{
"iso-md5",
"createtime",
"virtualbox-gaattach",
2013-12-19 17:54:00 -05:00
"pp-vagrant-override",
"virtualbox-rename",
"vmware-rename",
"parallels-headless",
"parallels-deprecations",
"sshkeypath",
"sshdisableagent",
"scaleway-access-key",
"manifest-filename",
"amazon-shutdown_behavior",
"amazon-enhanced-networking",
"amazon-private-ip",
"amazon-temp-sec-cidrs",
"docker-email",
"powershell-escapes",
2018-07-16 21:45:47 -04:00
"vmware-compaction",
"hyperv-deprecations",
"hyperv-vmxc-typo",
2019-03-29 18:18:14 -04:00
"hyperv-cpu-and-ram",
"clean-image-name",
"spot-price-auto-product",
2013-12-19 17:44:12 -05:00
}
2013-07-14 03:51:20 -04:00
}