ADD: added function to podcontroller to get number of childpods
This commit is contained in:
@@ -75,8 +75,10 @@ namespace kubecontrol
|
||||
void PodController::stopAllPods()
|
||||
{
|
||||
checkPodsHierarchy();
|
||||
|
||||
for (auto item : PodList_)
|
||||
{
|
||||
LOG_S(INFO)<<item.InfoPod.Uuid;
|
||||
item.InfoPod = *getPodInfo(item.getUUID()).get();
|
||||
item.stop(ServerAddress_+ApiCall_, BearerToken_);
|
||||
LOG_S(INFO)<< "stopping pod: "<<item.getUUID();
|
||||
@@ -181,10 +183,12 @@ namespace kubecontrol
|
||||
j = nlohmann::json::parse(response);
|
||||
if (j.contains("items"))
|
||||
{
|
||||
LOG_S(INFO)<<j["items"].size();
|
||||
int i = j["items"].size();
|
||||
for (int a = 0; a<i; a++)
|
||||
{
|
||||
auto item = std::make_shared<PodInfo>(j["items"][a].dump());
|
||||
auto item = std::make_unique<PodInfo>(j["items"][a].dump());
|
||||
// LOG_S(INFO)<<item->ToString();
|
||||
// item->Uuid = j["items"][a]["metadata"]["labels"]["app.kubernetes.io/name"].get<std::string>();
|
||||
// item->Component = j["items"][a]["metadata"]["labels"]["app.kubernetes.io/component"].get<std::string>();
|
||||
// item->Image = j["items"][a]["spec"]["containers"][0]["image"].get<std::string>();
|
||||
@@ -281,6 +285,11 @@ namespace kubecontrol
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
size_t PodController::getListOfChildPods()
|
||||
{
|
||||
return PodList_.size();
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::string PodController::performRequest(std::string curlURL)
|
||||
|
||||
Reference in New Issue
Block a user