MCPcopy Index your code
hub / github.com/abiosoft/colima / Exec

Method Exec

cli/chain.go:110–146  ·  view source on GitHub ↗

Exec executes the command chain. The first errored function terminates the chain and the error is returned. Otherwise, returns nil.

()

Source from the content-addressed store, hash-verified

108// The first errored function terminates the chain and the
109// error is returned. Otherwise, returns nil.
110func (a *ActiveCommandChain) Exec() error {
111 a.executing = true
112 defer func() { a.executing = false }()
113
114 for _, f := range a.funcs {
115 if f.f == nil {
116 if f.s != "" {
117 a.log.Println(f.s, "...")
118 a.lastStage = f.s
119 }
120 continue
121 }
122
123 // success
124 err := f.f()
125 if err == nil {
126 continue
127 }
128
129 // warning
130 if _, ok := err.(errNonFatal); ok {
131 if a.lastStage == "" {
132 a.log.Warnln(err)
133 } else {
134 a.log.Warnln(fmt.Errorf("error at '%s': %w", a.lastStage, err))
135 }
136 continue
137 }
138
139 // error
140 if a.lastStage == "" {
141 return err
142 }
143 return fmt.Errorf("error at '%s': %w", a.lastStage, err)
144 }
145 return nil
146}
147
148// Retry retries `f` up to `count` times at interval.
149// If after `count` attempts there is an error, the command chain is terminated with the final error.

Callers 15

ProvisionMethod · 0.80
StartMethod · 0.80
StopMethod · 0.80
provisionKubeconfigMethod · 0.80
ProvisionMethod · 0.80
StartMethod · 0.80
StopMethod · 0.80
TeardownMethod · 0.80
StartMethod · 0.80
StopMethod · 0.80
TeardownMethod · 0.80
provisionContainerdMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected