Merge pull request #10918 from spotinst/fix-list-igs

Spotinst: Prevent instance groups with the same suffix from being deleted
This commit is contained in:
Kubernetes Prow Robot 2021-02-24 17:43:24 -08:00 committed by GitHub
commit cc4f37df4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ func listInstanceGroups(svc InstanceGroupService, clusterName string) ([]*resour
var resourceTrackers []*resources.Resource
for _, group := range groups {
if strings.HasSuffix(group.Name(), clusterName) &&
if strings.HasSuffix(group.Name(), fmt.Sprintf(".%s", clusterName)) &&
!strings.HasPrefix(strings.ToLower(group.Name()), "spotinst::ocean::") {
resource := &resources.Resource{
ID: group.Id(),