Skip to content

Commit

Permalink
warn if snapshot_description is set but snapshot_volume is false
Browse files Browse the repository at this point in the history
  • Loading branch information
saxonww authored and lbajolet-hashicorp committed Apr 16, 2024
1 parent 4756795 commit 206964f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions builder/ebsvolume/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) {
"Packer, inclusion of enable_t2_unlimited will error your builds.")
}

for _, configVolumeMapping := range b.config.VolumeMappings {
if configVolumeMapping.SnapshotDescription != "" && configVolumeMapping.SnapshotVolume != true {
warns = append(warns, "snapshot_description is ignored when "+
"snapshot_volume is not set to true.")
}
}

if errs != nil && len(errs.Errors) > 0 {
return nil, warns, errs
}
Expand Down

0 comments on commit 206964f

Please sign in to comment.