Define workloads specs by YAML

This commit is contained in:
notpad
2019-12-19 09:08:11 +08:00
parent 30a5db136f
commit 6511b603c9
16 changed files with 747 additions and 18 deletions

View File

@@ -36,6 +36,7 @@ type IntegrationTestNodePreparer struct {
client clientset.Interface
countToStrategy []testutils.CountToStrategy
nodeNamePrefix string
nodeSpec *v1.Node
}
// NewIntegrationTestNodePreparer creates an IntegrationTestNodePreparer configured with defaults.
@@ -47,6 +48,15 @@ func NewIntegrationTestNodePreparer(client clientset.Interface, countToStrategy
}
}
// NewIntegrationTestNodePreparerWithNodeSpec creates an IntegrationTestNodePreparer configured with nodespec.
func NewIntegrationTestNodePreparerWithNodeSpec(client clientset.Interface, countToStrategy []testutils.CountToStrategy, nodeSpec *v1.Node) testutils.TestNodePreparer {
return &IntegrationTestNodePreparer{
client: client,
countToStrategy: countToStrategy,
nodeSpec: nodeSpec,
}
}
// PrepareNodes prepares countToStrategy test nodes.
func (p *IntegrationTestNodePreparer) PrepareNodes() error {
numNodes := 0
@@ -71,6 +81,11 @@ func (p *IntegrationTestNodePreparer) PrepareNodes() error {
},
},
}
if p.nodeSpec != nil {
baseNode = p.nodeSpec
}
for i := 0; i < numNodes; i++ {
var err error
for retry := 0; retry < retries; retry++ {