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 {
|
2020-05-28 17:37:29 -04:00
|
|
|
// DeprecatedOptions returns the name(s) of the option(s) being replaced in
|
|
|
|
// this fixer. It is used to generate a list of deprecated options that the
|
|
|
|
// template parser checks against to warn users that they need to call
|
|
|
|
// `packer fix` against their templates after upgrading.
|
2020-10-09 20:01:55 -04:00
|
|
|
DeprecatedOptions() map[string][]string
|
2020-05-28 17:37:29 -04:00
|
|
|
|
2013-07-14 03:51:20 -04:00
|
|
|
// 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 04:49:00 -04:00
|
|
|
|
|
|
|
// 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{
|
2017-09-05 21:09:31 -04: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),
|
2018-11-09 11:47:22 -05:00
|
|
|
"scaleway-access-key": new(FixerScalewayAccessKey),
|
2017-09-05 21:09:31 -04:00
|
|
|
"manifest-filename": new(FixerManifestFilename),
|
|
|
|
"amazon-shutdown_behavior": new(FixerAmazonShutdownBehavior),
|
|
|
|
"amazon-enhanced-networking": new(FixerAmazonEnhancedNetworking),
|
2018-02-08 19:47:17 -05:00
|
|
|
"amazon-private-ip": new(FixerAmazonPrivateIP),
|
2019-03-30 18:47:03 -04:00
|
|
|
"amazon-temp-sec-cidrs": new(FixerAmazonTemporarySecurityCIDRs),
|
2017-10-25 12:53:51 -04:00
|
|
|
"docker-email": new(FixerDockerEmail),
|
2017-10-29 20:14:06 -04:00
|
|
|
"powershell-escapes": new(FixerPowerShellEscapes),
|
2018-07-10 12:31:34 -04:00
|
|
|
"hyperv-deprecations": new(FixerHypervDeprecations),
|
2018-07-19 15:10:20 -04:00
|
|
|
"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),
|
2019-04-05 09:30:41 -04:00
|
|
|
"clean-image-name": new(FixerCleanImageName),
|
2019-06-28 17:20:02 -04:00
|
|
|
"spot-price-auto-product": new(FixerAmazonSpotPriceProductDeprecation),
|
2019-11-18 23:53:01 -05:00
|
|
|
"qemu-disk-size": new(FixerQEMUDiskSize),
|
2019-11-26 01:05:33 -05:00
|
|
|
"galaxy-command": new(FixerGalaxyCommand),
|
2020-01-09 11:37:30 -05:00
|
|
|
"comm-config": new(FixerCommConfig),
|
|
|
|
"ssh-wait-timeout": new(FixerSSHTimout),
|
2020-05-06 20:01:12 -04:00
|
|
|
"docker-tag-tags": new(FixerDockerTagtoTags),
|
2020-05-19 10:06:12 -04:00
|
|
|
"vsphere-iso-net-disk": new(FixerVSphereNetworkDisk),
|
2020-05-28 16:14:45 -04:00
|
|
|
"iso-checksum-type-and-url": new(FixerISOChecksumTypeAndURL),
|
2020-06-02 05:56:36 -04:00
|
|
|
"qemu-host-port": new(FixerQEMUHostPort),
|
2020-10-07 05:08:33 -04:00
|
|
|
"azure-exclude_from_latest": new(FixerAzureExcludeFromLatest),
|
2020-10-11 14:39:24 -04:00
|
|
|
"proxmox-type": new(FixerProxmoxType),
|
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",
|
2013-12-22 19:01:28 -05:00
|
|
|
"virtualbox-rename",
|
2013-12-25 13:13:32 -05:00
|
|
|
"vmware-rename",
|
2015-08-24 09:09:29 -04:00
|
|
|
"parallels-headless",
|
2015-09-18 03:27:50 -04:00
|
|
|
"parallels-deprecations",
|
2015-07-13 10:56:11 -04:00
|
|
|
"sshkeypath",
|
2017-06-19 10:21:33 -04:00
|
|
|
"sshdisableagent",
|
2018-11-09 11:47:22 -05:00
|
|
|
"scaleway-access-key",
|
2016-11-21 18:34:50 -05:00
|
|
|
"manifest-filename",
|
2016-12-14 15:50:26 -05:00
|
|
|
"amazon-shutdown_behavior",
|
2017-09-05 21:09:31 -04:00
|
|
|
"amazon-enhanced-networking",
|
2018-02-08 19:47:17 -05:00
|
|
|
"amazon-private-ip",
|
2019-03-30 18:47:03 -04:00
|
|
|
"amazon-temp-sec-cidrs",
|
2017-10-25 12:53:51 -04:00
|
|
|
"docker-email",
|
2020-05-06 20:01:12 -04:00
|
|
|
"docker-tag-tags",
|
2017-10-29 20:14:06 -04:00
|
|
|
"powershell-escapes",
|
2018-07-16 21:45:47 -04:00
|
|
|
"vmware-compaction",
|
2019-07-24 11:28:08 -04:00
|
|
|
"hyperv-deprecations",
|
|
|
|
"hyperv-vmxc-typo",
|
2019-03-29 18:18:14 -04:00
|
|
|
"hyperv-cpu-and-ram",
|
2019-04-05 09:30:41 -04:00
|
|
|
"clean-image-name",
|
2019-06-28 17:20:02 -04:00
|
|
|
"spot-price-auto-product",
|
2019-11-18 23:53:01 -05:00
|
|
|
"qemu-disk-size",
|
2019-11-26 01:05:33 -05:00
|
|
|
"galaxy-command",
|
2020-01-09 11:37:30 -05:00
|
|
|
"comm-config",
|
|
|
|
"ssh-wait-timeout",
|
2020-05-19 10:06:12 -04:00
|
|
|
"vsphere-iso-net-disk",
|
2020-05-28 16:14:45 -04:00
|
|
|
"iso-checksum-type-and-url",
|
2020-06-02 05:56:36 -04:00
|
|
|
"qemu-host-port",
|
2020-10-07 05:08:33 -04:00
|
|
|
"azure-exclude_from_latest",
|
2020-10-11 14:39:24 -04:00
|
|
|
"proxmox-type",
|
2013-12-19 17:44:12 -05:00
|
|
|
}
|
2013-07-14 03:51:20 -04:00
|
|
|
}
|