|
|
|
|
@ -276,11 +276,18 @@ func (c *Config) Prepare(raws ...interface{}) error {
|
|
|
|
|
errs, errors.New("'shape' must be specified"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if c.SubnetID == "" {
|
|
|
|
|
if (c.SubnetID == "") && (c.CreateVnicDetails.SubnetId == nil) {
|
|
|
|
|
errs = packer.MultiErrorAppend(
|
|
|
|
|
errs, errors.New("'subnet_ocid' must be specified"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if c.CreateVnicDetails.SubnetId == nil {
|
|
|
|
|
c.CreateVnicDetails.SubnetId = &c.SubnetID
|
|
|
|
|
} else if (*c.CreateVnicDetails.SubnetId != c.SubnetID) && (c.SubnetID != "") {
|
|
|
|
|
errs = packer.MultiErrorAppend(
|
|
|
|
|
errs, errors.New("'create_vnic_details[subnet]' must match 'subnet_ocid' if both are specified"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (c.BaseImageID == "") && (c.BaseImageFilter == ListImagesRequest{}) {
|
|
|
|
|
errs = packer.MultiErrorAppend(
|
|
|
|
|
errs, errors.New("'base_image_ocid' or 'base_image_filter' must be specified"))
|
|
|
|
|
|