[MM-55170] Improve error message when trying to activate a plugin in an unsupported environment (#25160)

Этот коммит содержится в:
Ben Schumacher
2023-11-01 12:18:50 +01:00
коммит произвёл GitHub
родитель c91f85124c
Коммит 73fba481ed

Просмотреть файл

@@ -54,15 +54,14 @@ func newSupervisor(pluginInfo *model.BundleInfo, apiImpl API, driver Driver, par
}, },
} }
executable := filepath.Clean(filepath.Join( executable := pluginInfo.Manifest.GetExecutableForRuntime(runtime.GOOS, runtime.GOARCH)
".",
pluginInfo.Manifest.GetExecutableForRuntime(runtime.GOOS, runtime.GOARCH),
))
if executable == "" { if executable == "" {
return nil, fmt.Errorf("backend executable not found for environment %s/%s", runtime.GOOS, runtime.GOARCH) return nil, fmt.Errorf("backend executable not found for environment: %s/%s", runtime.GOOS, runtime.GOARCH)
} }
executable = filepath.Clean(filepath.Join(".", executable))
if strings.HasPrefix(executable, "..") { if strings.HasPrefix(executable, "..") {
return nil, fmt.Errorf("invalid backend executable") return nil, fmt.Errorf("invalid backend executable: %s", executable)
} }
executable = filepath.Join(pluginInfo.Path, executable) executable = filepath.Join(pluginInfo.Path, executable)