feature: error handling for cgroup (#1486)
* Error for cgroup mountpoint Added handling of message: cgroup mountpoint does not exist. * Case for error cgroup Added case and case description for: Cgroup Mountpoint Does Not Exist * Case for Runc Added error handling for Runc, which does not work in cgroup v2. Changed numbering of new errors. * stdErr handling fot run_container Enabling stdErr handling fot run_container.sh * change for stdErr handling * Another place to handle the error 211 Another place to handle the error: ServerRuncNotWorkOnCgroupsV2 * test_1 * test 2 * test 3 * Moving error handling Moving error handling to the right place in the controller. * Polishing * Еext correction Сorrection of description text.
This commit is contained in:
parent
c44ce0d77c
commit
7169480999
3 changed files with 16 additions and 5 deletions
|
|
@ -439,15 +439,22 @@ ErrorCode ServerController::buildContainerWorker(const ServerCredentials &creden
|
|||
stdOut += data + "\n";
|
||||
return ErrorCode::NoError;
|
||||
};
|
||||
auto cbReadStdErr = [&](const QString &data, libssh::Client &) {
|
||||
stdOut += data + "\n";
|
||||
return ErrorCode::NoError;
|
||||
};
|
||||
|
||||
errorCode =
|
||||
ErrorCode error =
|
||||
runScript(credentials,
|
||||
replaceVars(amnezia::scriptData(SharedScriptType::build_container), genVarsForScript(credentials, container, config)),
|
||||
cbReadStdOut);
|
||||
if (errorCode)
|
||||
return errorCode;
|
||||
cbReadStdOut, cbReadStdErr);
|
||||
|
||||
if (stdOut.contains("doesn't work on cgroups v2"))
|
||||
return ErrorCode::ServerDockerOnCgroupsV2;
|
||||
if (stdOut.contains("cgroup mountpoint does not exist"))
|
||||
return ErrorCode::ServerCgroupMountpoint;
|
||||
|
||||
return errorCode;
|
||||
return error;
|
||||
}
|
||||
|
||||
ErrorCode ServerController::runContainerWorker(const ServerCredentials &credentials, DockerContainer container, QJsonObject &config)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue