mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 06:02:18 +00:00
rename resize to scale
This commit is contained in:
@@ -112,20 +112,20 @@ func computeRCCounts(total int) (int, int, int) {
|
||||
return smallRCCount, mediumRCCount, bigRCCount
|
||||
}
|
||||
|
||||
// The function creates a RC and then every few second resize it and with 0.1 probability deletes it.
|
||||
// The function creates a RC and then every few second scale it and with 0.1 probability deletes it.
|
||||
func playWithRC(c *client.Client, wg *sync.WaitGroup, ns, name string, size int) {
|
||||
defer GinkgoRecover()
|
||||
defer wg.Done()
|
||||
rcExist := false
|
||||
// Once every 1-2 minutes perform resize of RC.
|
||||
// Once every 1-2 minutes perform scale of RC.
|
||||
for start := time.Now(); time.Since(start) < simulationTime; time.Sleep(time.Duration(60+rand.Intn(60)) * time.Second) {
|
||||
if !rcExist {
|
||||
expectNoError(RunRC(c, name, ns, image, size), fmt.Sprintf("creating rc %s in namespace %s", name, ns))
|
||||
rcExist = true
|
||||
}
|
||||
// Resize RC to a random size between 0.5x and 1.5x of the original size.
|
||||
// Scale RC to a random size between 0.5x and 1.5x of the original size.
|
||||
newSize := uint(rand.Intn(size+1) + size/2)
|
||||
expectNoError(ResizeRC(c, ns, name, newSize), fmt.Sprintf("resizing rc %s in namespace %s", name, ns))
|
||||
expectNoError(ScaleRC(c, ns, name, newSize), fmt.Sprintf("scaling rc %s in namespace %s", name, ns))
|
||||
// With probability 0.1 remove this RC.
|
||||
if rand.Intn(10) == 0 {
|
||||
expectNoError(DeleteRC(c, ns, name), fmt.Sprintf("deleting rc %s in namespace %s", name, ns))
|
||||
|
Reference in New Issue
Block a user