Skip to content

Commit 861b0c8

Browse files
mpfz0rMarius Sturm
authored and
Marius Sturm
committed
Fix sidecar crash when using "svc" runner under linux (#324)
Avoid calling a nil function in the runnerRegistry. This error is not reported to the UI. We do have validations that should prevent this from being configured. So this is more like a second safety net.
1 parent a257140 commit 861b0c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

daemon/daemon.go

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ func RegisterBackendRunner(name string, c RunnerCreator) error {
7373

7474
func (dc *DaemonConfig) AddRunner(backend backends.Backend, context *context.Ctx) {
7575
var runner Runner
76+
if runnerRegistry[backend.ServiceType] == nil {
77+
backend.SetStatusLogErrorf("Execution driver %s is not supported on this platform", backend.ServiceType)
78+
return
79+
}
7680
switch backend.ServiceType {
7781
case "exec":
7882
runner = runnerRegistry["exec"](backend, context)

0 commit comments

Comments
 (0)