[MM-55170] Improve error message when trying to activate a plugin in an unsupported environment (#25160)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c91f85124c
Коммит
73fba481ed
@@ -54,15 +54,14 @@ func newSupervisor(pluginInfo *model.BundleInfo, apiImpl API, driver Driver, par
|
||||
},
|
||||
}
|
||||
|
||||
executable := filepath.Clean(filepath.Join(
|
||||
".",
|
||||
pluginInfo.Manifest.GetExecutableForRuntime(runtime.GOOS, runtime.GOARCH),
|
||||
))
|
||||
executable := pluginInfo.Manifest.GetExecutableForRuntime(runtime.GOOS, runtime.GOARCH)
|
||||
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, "..") {
|
||||
return nil, fmt.Errorf("invalid backend executable")
|
||||
return nil, fmt.Errorf("invalid backend executable: %s", executable)
|
||||
}
|
||||
|
||||
executable = filepath.Join(pluginInfo.Path, executable)
|
||||
|
||||
Ссылка в новой задаче
Block a user