mirror of https://github.com/kubernetes/kops.git
aws: Ignore volumes set to delete on instance termination
This commit is contained in:
parent
21c0a89676
commit
8a2f74ce46
|
@ -561,6 +561,17 @@ func ListVolumes(cloud fi.Cloud, clusterName string) ([]*resources.Resource, err
|
||||||
for _, volume := range volumes {
|
for _, volume := range volumes {
|
||||||
id := aws.StringValue(volume.VolumeId)
|
id := aws.StringValue(volume.VolumeId)
|
||||||
|
|
||||||
|
deleteOnTermination := false
|
||||||
|
for _, attachment := range volume.Attachments {
|
||||||
|
if aws.BoolValue(attachment.DeleteOnTermination) {
|
||||||
|
deleteOnTermination = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if deleteOnTermination {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
resourceTracker := &resources.Resource{
|
resourceTracker := &resources.Resource{
|
||||||
Name: FindName(volume.Tags),
|
Name: FindName(volume.Tags),
|
||||||
ID: id,
|
ID: id,
|
||||||
|
|
Loading…
Reference in New Issue