Move commons structs from scale_up_test.go to scale_test_common.go

This commit is contained in:
Łukasz Osipiuk 2018-05-10 16:45:09 +02:00
parent 74b540fdab
commit 8bdc6a1bdc
2 changed files with 46 additions and 25 deletions

View File

@ -0,0 +1,46 @@
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package core
import (
"k8s.io/autoscaler/cluster-autoscaler/context"
)
type nodeConfig struct {
name string
cpu int64
memory int64
ready bool
group string
}
type podConfig struct {
name string
cpu int64
memory int64
node string
}
type scaleTestConfig struct {
nodes []nodeConfig
pods []podConfig
extraPods []podConfig
expectedScaleUp string
expectedScaleUpGroup string
expectedScaleDowns []string
options context.AutoscalingOptions
}

View File

@ -46,31 +46,6 @@ import (
"github.com/stretchr/testify/assert"
)
type nodeConfig struct {
name string
cpu int64
memory int64
ready bool
group string
}
type podConfig struct {
name string
cpu int64
memory int64
node string
}
type scaleTestConfig struct {
nodes []nodeConfig
pods []podConfig
extraPods []podConfig
expectedScaleUp string
expectedScaleUpGroup string
expectedScaleDowns []string
options context.AutoscalingOptions
}
var defaultOptions = context.AutoscalingOptions{
EstimatorName: estimator.BinpackingEstimatorName,
MaxCoresTotal: config.DefaultMaxClusterCores,