Merge pull request #5036 from grosser/grosser/join
use strings.Join to build list of names
This commit is contained in:
commit
07ea116616
|
|
@ -17,10 +17,10 @@ limitations under the License.
|
|||
package cloudprovider
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"math"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// ResourceLimiter contains limits (max, min) for resources (cores, memory etc.).
|
||||
|
|
@ -82,12 +82,9 @@ func (r *ResourceLimiter) HasMaxLimitSet(resourceName string) bool {
|
|||
}
|
||||
|
||||
func (r *ResourceLimiter) String() string {
|
||||
var buffer bytes.Buffer
|
||||
var resourceDetails = []string{}
|
||||
for _, name := range r.GetResources() {
|
||||
if buffer.Len() > 0 {
|
||||
buffer.WriteString(", ")
|
||||
resourceDetails = append(resourceDetails, fmt.Sprintf("{%s : %d - %d}", name, r.GetMin(name), r.GetMax(name)))
|
||||
}
|
||||
buffer.WriteString(fmt.Sprintf("{%s : %d - %d}", name, r.GetMin(name), r.GetMax(name)))
|
||||
}
|
||||
return buffer.String()
|
||||
return strings.Join(resourceDetails, ", ")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ limitations under the License.
|
|||
package core
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"math"
|
||||
"strings"
|
||||
|
|
@ -585,14 +584,11 @@ func ScaleUp(context *context.AutoscalingContext, processors *ca_processors.Auto
|
|||
}
|
||||
}
|
||||
if len(targetNodeGroups) > 1 {
|
||||
var buffer bytes.Buffer
|
||||
for i, ng := range targetNodeGroups {
|
||||
if i > 0 {
|
||||
buffer.WriteString(", ")
|
||||
var names = []string{}
|
||||
for _, ng := range targetNodeGroups {
|
||||
names = append(names, ng.Id())
|
||||
}
|
||||
buffer.WriteString(ng.Id())
|
||||
}
|
||||
klog.V(1).Infof("Splitting scale-up between %v similar node groups: {%v}", len(targetNodeGroups), buffer.String())
|
||||
klog.V(1).Infof("Splitting scale-up between %v similar node groups: {%v}", len(targetNodeGroups), strings.Join(names, ", "))
|
||||
}
|
||||
}
|
||||
scaleUpInfos, typedErr := processors.NodeGroupSetProcessor.BalanceScaleUpBetweenGroups(
|
||||
|
|
|
|||
Loading…
Reference in New Issue