spelling: delete
This commit is contained in:
parent
dfcd5742cc
commit
939e7d5587
|
@ -89,7 +89,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
|
|||
steps = []multistep.Step{
|
||||
&stepPreValidate{
|
||||
AlicloudDestImageName: b.config.AlicloudImageName,
|
||||
ForceDelete: b.config.AlicloudImageForceDetele,
|
||||
ForceDelete: b.config.AlicloudImageForceDelete,
|
||||
},
|
||||
&stepCheckAlicloudSourceImage{
|
||||
SourceECSImageId: b.config.AlicloudSourceImage,
|
||||
|
@ -165,8 +165,8 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
|
|||
ForceStop: b.config.ForceStopInstance,
|
||||
},
|
||||
&stepDeleteAlicloudImageSnapshots{
|
||||
AlicloudImageForceDeteleSnapshots: b.config.AlicloudImageForceDeteleSnapshots,
|
||||
AlicloudImageForceDetele: b.config.AlicloudImageForceDetele,
|
||||
AlicloudImageForceDeleteSnapshots: b.config.AlicloudImageForceDeleteSnapshots,
|
||||
AlicloudImageForceDelete: b.config.AlicloudImageForceDelete,
|
||||
AlicloudImageName: b.config.AlicloudImageName,
|
||||
},
|
||||
&stepCreateAlicloudImage{},
|
||||
|
|
|
@ -32,8 +32,8 @@ type AlicloudImageConfig struct {
|
|||
AlicloudImageUNShareAccounts []string `mapstructure:"image_unshare_account"`
|
||||
AlicloudImageDestinationRegions []string `mapstructure:"image_copy_regions"`
|
||||
AlicloudImageDestinationNames []string `mapstructure:"image_copy_names"`
|
||||
AlicloudImageForceDetele bool `mapstructure:"image_force_delete"`
|
||||
AlicloudImageForceDeteleSnapshots bool `mapstructure:"image_force_delete_snapshots"`
|
||||
AlicloudImageForceDelete bool `mapstructure:"image_force_delete"`
|
||||
AlicloudImageForceDeleteSnapshots bool `mapstructure:"image_force_delete_snapshots"`
|
||||
AlicloudImageForceDeleteInstances bool `mapstructure:"image_force_delete_instances"`
|
||||
AlicloudImageSkipRegionValidation bool `mapstructure:"skip_region_validation"`
|
||||
AlicloudDiskDevices `mapstructure:",squash"`
|
||||
|
|
|
@ -12,8 +12,8 @@ import (
|
|||
)
|
||||
|
||||
type stepDeleteAlicloudImageSnapshots struct {
|
||||
AlicloudImageForceDetele bool
|
||||
AlicloudImageForceDeteleSnapshots bool
|
||||
AlicloudImageForceDelete bool
|
||||
AlicloudImageForceDeleteSnapshots bool
|
||||
AlicloudImageName string
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ func (s *stepDeleteAlicloudImageSnapshots) Run(_ context.Context, state multiste
|
|||
config := state.Get("config").(Config)
|
||||
ui.Say("Deleting image snapshots.")
|
||||
// Check for force delete
|
||||
if s.AlicloudImageForceDetele {
|
||||
if s.AlicloudImageForceDelete {
|
||||
images, _, err := client.DescribeImages(&ecs.DescribeImagesArgs{
|
||||
RegionId: common.Region(config.AlicloudRegion),
|
||||
ImageName: s.AlicloudImageName,
|
||||
|
@ -43,7 +43,7 @@ func (s *stepDeleteAlicloudImageSnapshots) Run(_ context.Context, state multiste
|
|||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
if s.AlicloudImageForceDeteleSnapshots {
|
||||
if s.AlicloudImageForceDeleteSnapshots {
|
||||
for _, diskDevice := range image.DiskDeviceMappings.DiskDeviceMapping {
|
||||
if err := client.DeleteSnapshot(diskDevice.SnapshotId); err != nil {
|
||||
err := fmt.Errorf("Deleting ECS snapshot failed: %s", err)
|
||||
|
|
|
@ -60,7 +60,7 @@ type Config struct {
|
|||
Architecture string `mapstructure:"image_architecture"`
|
||||
Size string `mapstructure:"image_system_size"`
|
||||
Format string `mapstructure:"format"`
|
||||
AlicloudImageForceDetele bool `mapstructure:"image_force_delete"`
|
||||
AlicloudImageForceDelete bool `mapstructure:"image_force_delete"`
|
||||
|
||||
ctx interpolate.Context
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
|
|||
getEndPonit(p.config.OSSBucket), p.config.OSSKey, err)
|
||||
}
|
||||
|
||||
if len(images) > 0 && !p.config.AlicloudImageForceDetele {
|
||||
if len(images) > 0 && !p.config.AlicloudImageForceDelete {
|
||||
return nil, false, fmt.Errorf("Duplicated image exists, please delete the existing images " +
|
||||
"or set the 'image_force_delete' value as true")
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
|
|||
if err != nil {
|
||||
return nil, false, fmt.Errorf("Failed to upload image %s: %s", source, err)
|
||||
}
|
||||
if len(images) > 0 && p.config.AlicloudImageForceDetele {
|
||||
if len(images) > 0 && p.config.AlicloudImageForceDelete {
|
||||
if err = ecsClient.DeleteImage(packercommon.Region(p.config.AlicloudRegion),
|
||||
images[0].ImageId); err != nil {
|
||||
return nil, false, fmt.Errorf("Delete duplicated image %s failed", images[0].ImageName)
|
||||
|
|
Loading…
Reference in New Issue