Check if spot price is empty, when spot_tags is set
This commit is contained in:
parent
3dbf1cb371
commit
2fec76ea87
|
@ -77,10 +77,6 @@ func (c *RunConfig) Prepare(ctx *interpolate.Context) []error {
|
||||||
c.RunTags = make(map[string]string)
|
c.RunTags = make(map[string]string)
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.SpotTags == nil {
|
|
||||||
c.SpotTags = make(map[string]string)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validation
|
// Validation
|
||||||
errs := c.Comm.Prepare(ctx)
|
errs := c.Comm.Prepare(ctx)
|
||||||
|
|
||||||
|
@ -123,6 +119,13 @@ func (c *RunConfig) Prepare(ctx *interpolate.Context) []error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.SpotTags != nil {
|
||||||
|
if c.SpotPrice == "" || c.SpotPrice == "0" {
|
||||||
|
errs = append(errs, fmt.Errorf(
|
||||||
|
"spot_tags should not be set when not requesting a spot instance"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if c.UserData != "" && c.UserDataFile != "" {
|
if c.UserData != "" && c.UserDataFile != "" {
|
||||||
errs = append(errs, fmt.Errorf("Only one of user_data or user_data_file can be specified."))
|
errs = append(errs, fmt.Errorf("Only one of user_data or user_data_file can be specified."))
|
||||||
} else if c.UserDataFile != "" {
|
} else if c.UserDataFile != "" {
|
||||||
|
|
|
@ -344,7 +344,7 @@ builder.
|
||||||
`Linux/UNIX (Amazon VPC)`, `SUSE Linux (Amazon VPC)`, `Windows (Amazon VPC)`
|
`Linux/UNIX (Amazon VPC)`, `SUSE Linux (Amazon VPC)`, `Windows (Amazon VPC)`
|
||||||
|
|
||||||
- `spot_tags` (object of key/value strings) - Requires `spot_price` to
|
- `spot_tags` (object of key/value strings) - Requires `spot_price` to
|
||||||
be set. This tells Packer to aplly tags to the spot request that is
|
be set. This tells Packer to apply tags to the spot request that is
|
||||||
issued.
|
issued.
|
||||||
|
|
||||||
- `sriov_support` (boolean) - Enable enhanced networking (SriovNetSupport but not ENA)
|
- `sriov_support` (boolean) - Enable enhanced networking (SriovNetSupport but not ENA)
|
||||||
|
|
|
@ -337,7 +337,7 @@ builder.
|
||||||
`Linux/UNIX (Amazon VPC)`, `SUSE Linux (Amazon VPC)`, `Windows (Amazon VPC)`
|
`Linux/UNIX (Amazon VPC)`, `SUSE Linux (Amazon VPC)`, `Windows (Amazon VPC)`
|
||||||
|
|
||||||
- `spot_tags` (object of key/value strings) - Requires `spot_price` to
|
- `spot_tags` (object of key/value strings) - Requires `spot_price` to
|
||||||
be set. This tells Packer to aplly tags to the spot request that is
|
be set. This tells Packer to apply tags to the spot request that is
|
||||||
issued.
|
issued.
|
||||||
|
|
||||||
- `sriov_support` (boolean) - Enable enhanced networking (SriovNetSupport but not ENA)
|
- `sriov_support` (boolean) - Enable enhanced networking (SriovNetSupport but not ENA)
|
||||||
|
|
|
@ -265,7 +265,7 @@ builder.
|
||||||
`Linux/UNIX (Amazon VPC)`, `SUSE Linux (Amazon VPC)` or `Windows (Amazon VPC)`
|
`Linux/UNIX (Amazon VPC)`, `SUSE Linux (Amazon VPC)` or `Windows (Amazon VPC)`
|
||||||
|
|
||||||
- `spot_tags` (object of key/value strings) - Requires `spot_price` to
|
- `spot_tags` (object of key/value strings) - Requires `spot_price` to
|
||||||
be set. This tells Packer to aplly tags to the spot request that is
|
be set. This tells Packer to apply tags to the spot request that is
|
||||||
issued.
|
issued.
|
||||||
|
|
||||||
- `sriov_support` (boolean) - Enable enhanced networking (SriovNetSupport but not ENA)
|
- `sriov_support` (boolean) - Enable enhanced networking (SriovNetSupport but not ENA)
|
||||||
|
|
|
@ -340,7 +340,7 @@ builder.
|
||||||
`Linux/UNIX (Amazon VPC)`, `SUSE Linux (Amazon VPC)`, `Windows (Amazon VPC)`
|
`Linux/UNIX (Amazon VPC)`, `SUSE Linux (Amazon VPC)`, `Windows (Amazon VPC)`
|
||||||
|
|
||||||
- `spot_tags` (object of key/value strings) - Requires `spot_price` to
|
- `spot_tags` (object of key/value strings) - Requires `spot_price` to
|
||||||
be set. This tells Packer to aplly tags to the spot request that is
|
be set. This tells Packer to apply tags to the spot request that is
|
||||||
issued.
|
issued.
|
||||||
|
|
||||||
- `sriov_support` (boolean) - Enable enhanced networking (SriovNetSupport but not ENA)
|
- `sriov_support` (boolean) - Enable enhanced networking (SriovNetSupport but not ENA)
|
||||||
|
|
Loading…
Reference in New Issue