Skip to content

Commit

Permalink
Merge pull request #2480 from jaypipes/rework-placeholder-match
Browse files Browse the repository at this point in the history
[aws] use simple string prefix placeholder match
  • Loading branch information
k8s-ci-robot authored Oct 28, 2019
2 parents 589cd2a + 72f936e commit e536639
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package aws
import (
"fmt"
"reflect"
"regexp"
"strings"
"sync"

Expand Down Expand Up @@ -286,8 +285,7 @@ func (m *asgCache) DeleteInstances(instances []*AwsInstanceRef) error {

// isPlaceholderInstance checks if the given instance is only a placeholder
func (m *asgCache) isPlaceholderInstance(instance *AwsInstanceRef) bool {
matched, _ := regexp.MatchString(fmt.Sprintf("^%s.*\\d+$", placeholderInstanceNamePrefix), instance.Name)
return matched
return strings.HasPrefix(instance.Name, placeholderInstanceNamePrefix)
}

// Fetch automatically discovered ASGs. These ASGs should be unregistered if
Expand Down

0 comments on commit e536639

Please sign in to comment.