forked from hashicorp/packer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fixer.go
101 lines (94 loc) · 3.76 KB
/
fixer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package fix
// A Fixer is something that can perform a fix operation on a template.
type Fixer interface {
// 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.
DeprecatedOptions() map[string][]string
// 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
}
// Fixers is the map of all available fixers, by name.
var Fixers map[string]Fixer
// FixerOrder is the default order the fixers should be run.
var FixerOrder []string
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),
"hyperv-cpu-and-ram": new(FizerHypervCPUandRAM),
"vmware-compaction": new(FixerVMwareCompaction),
"clean-image-name": new(FixerCleanImageName),
"spot-price-auto-product": new(FixerAmazonSpotPriceProductDeprecation),
"qemu-disk-size": new(FixerQEMUDiskSize),
"galaxy-command": new(FixerGalaxyCommand),
"comm-config": new(FixerCommConfig),
"ssh-wait-timeout": new(FixerSSHTimout),
"docker-tag-tags": new(FixerDockerTagtoTags),
"vsphere-iso-net-disk": new(FixerVSphereNetworkDisk),
"iso-checksum-type-and-url": new(FixerISOChecksumTypeAndURL),
"qemu-host-port": new(FixerQEMUHostPort),
"azure-exclude_from_latest": new(FixerAzureExcludeFromLatest),
"proxmox-type": new(FixerProxmoxType),
}
FixerOrder = []string{
"iso-md5",
"createtime",
"virtualbox-gaattach",
"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",
"docker-tag-tags",
"powershell-escapes",
"vmware-compaction",
"hyperv-deprecations",
"hyperv-vmxc-typo",
"hyperv-cpu-and-ram",
"clean-image-name",
"spot-price-auto-product",
"qemu-disk-size",
"galaxy-command",
"comm-config",
"ssh-wait-timeout",
"vsphere-iso-net-disk",
"iso-checksum-type-and-url",
"qemu-host-port",
"azure-exclude_from_latest",
"proxmox-type",
}
}