Skip to content

Commit

Permalink
Merge pull request #3757 from mcristina422/reduceLogging2
Browse files Browse the repository at this point in the history
Reduce logging when creating placeholder instances
  • Loading branch information
k8s-ci-robot authored Feb 17, 2021
2 parents cd30499 + 7e37e5b commit f9751f1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,15 @@ func (m *asgCache) regenerate() error {
func (m *asgCache) createPlaceholdersForDesiredNonStartedInstances(groups []*autoscaling.Group) []*autoscaling.Group {
for _, g := range groups {
desired := *g.DesiredCapacity
real := int64(len(g.Instances))
if desired <= real {
realInstances := int64(len(g.Instances))
if desired <= realInstances {
continue
}

for i := real; i < desired; i++ {
klog.V(4).Infof("Instance group %s has only %d instances created while requested count is %d. "+
"Creating placeholder instances.", *g.AutoScalingGroupName, realInstances, desired)
for i := realInstances; i < desired; i++ {
id := fmt.Sprintf("%s-%s-%d", placeholderInstanceNamePrefix, *g.AutoScalingGroupName, i)
klog.V(4).Infof("Instance group %s has only %d instances created while requested count is %d. "+
"Creating placeholder instance with ID %s.", *g.AutoScalingGroupName, real, desired, id)
g.Instances = append(g.Instances, &autoscaling.Instance{
InstanceId: &id,
AvailabilityZone: g.AvailabilityZones[0],
Expand Down

0 comments on commit f9751f1

Please sign in to comment.