MCPcopy Create free account
hub / github.com/conforma/cli / startAndSetupState

Function startAndSetupState

acceptance/kubernetes/kubernetes.go:78–94  ·  view source on GitHub ↗

startAndSetupState starts the cluster via the provided startFunc. The crosscutting concern of setting up the ClusterState in the Context and making sure we don't start the cluster multiple times per Context is handled here

(start startFunc)

Source from the content-addressed store, hash-verified

76// crosscutting concern of setting up the ClusterState in the Context and making
77// sure we don't start the cluster multiple times per Context is handled here
78func startAndSetupState(start startFunc) func(context.Context) (context.Context, error) {
79 return func(ctx context.Context) (context.Context, error) {
80 c := &ClusterState{}
81 ctx, err := testenv.SetupState(ctx, &c)
82 if err != nil {
83 return ctx, err
84 }
85
86 if c.Up(ctx) {
87 return ctx, nil
88 }
89
90 ctx, c.cluster, err = start(ctx)
91
92 return ctx, err
93 }
94}
95
96// mustBeUp makes sure that the cluster is up, used by functions that require
97// the cluster to be up

Callers 1

AddStepsToFunction · 0.85

Calls 2

UpMethod · 0.95
SetupStateFunction · 0.92

Tested by

no test coverage detected