github.com/caos/orbos@v1.5.14-0.20221103111702-e6cd0cea7ad4/cmd/chore/e2e/run/downscale.go (about)

     1  package main
     2  
     3  import (
     4  	"context"
     5  	"fmt"
     6  	"time"
     7  )
     8  
     9  var _ testFunc = downscale
    10  
    11  func downscale(_ *testSpecs, settings programSettings, conditions *conditions) interactFunc {
    12  
    13  	// assignments must be done also when test is skipped
    14  	conditions.kubernetes.ControlPlane.Nodes = 1
    15  	conditions.kubernetes.Workers[0].Nodes = 1
    16  	conditions.orbiter.watcher = watch(10*time.Minute, orbiter)
    17  	conditions.testCase = nil
    18  
    19  	return func(ctx context.Context, _ uint8, orbctl newOrbctlCommandFunc) error {
    20  
    21  		if err := patch(ctx, settings, orbctl, fmt.Sprintf("clusters.%s.spec.controlplane.nodes", settings.orbID), "1"); err != nil {
    22  			return err
    23  		}
    24  
    25  		return patch(ctx, settings, orbctl, fmt.Sprintf("clusters.%s.spec.workers.0.nodes", settings.orbID), "1")
    26  	}
    27  }