FIX: fixed issue where the response of the kube api was not written correct
This commit is contained in:
@@ -226,12 +226,13 @@ namespace kubecontrol
|
||||
request.perform();
|
||||
|
||||
request.reset();
|
||||
auto response = mWriterChunk.getResponse();
|
||||
std::string response = mWriterChunk.getResponse();
|
||||
InfoPod.update(response);
|
||||
|
||||
while (InfoPod.Status != "Running") {
|
||||
while (InfoPod.Status != "Running" && InfoPod.Status != "Succeeded") {
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
response = this->getInfo(curlURL, token);
|
||||
response = this->getInfo(curlURL, token);
|
||||
|
||||
InfoPod.update(response);
|
||||
|
||||
}
|
||||
@@ -348,8 +349,7 @@ namespace kubecontrol
|
||||
|
||||
|
||||
request.perform();
|
||||
auto response = mWriterChunk.getResponse();
|
||||
return response;
|
||||
return mWriterChunk.getResponse();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace kubecontrol
|
||||
Component = j["metadata"]["labels"]["app.kubernetes.io/component"].get<std::string>();
|
||||
PartOf = j["metadata"]["labels"]["app.kubernetes.io/part-of"].get<std::string>();
|
||||
Image = j["spec"]["containers"][0]["image"].get<std::string>();
|
||||
|
||||
if (j["status"].contains("podIP")) Ip = j["status"]["podIP"].get<std::string>();
|
||||
|
||||
Status = j["status"]["phase"].get<std::string>();
|
||||
@@ -57,7 +56,8 @@ namespace kubecontrol
|
||||
|
||||
|
||||
} catch (std::exception& e)
|
||||
{
|
||||
{
|
||||
// LOG_S(WARNING)<< response;
|
||||
LOG_S(ERROR)<<e.what();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user