ADD: adden function to get PodInfo for a specific pod from podcontroler

This commit is contained in:
Henry Winkel
2023-08-16 17:09:36 +02:00
parent 89465f06a5
commit 5d3dcb25db
2 changed files with 14 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ namespace kubecontrol
void checkPodsHierarchy();
std::string getPodsInfoForAll();
std::shared_ptr<PodInfo> getPodsInfo(std::string uuid);
private:
std::vector<KubePod> PodList_;

View File

@@ -227,6 +227,19 @@ namespace kubecontrol
}
std::shared_ptr<PodInfo> PodController::getPodsInfo(std::string uuid)
{
for (int i = 0; i < podsInfoList_.size(); i++) {
if (podsInfoList_[i]->Uuid == uuid)
{
return podsInfoList_[i];
}
}
return nullptr;
}
// void PodController::addPodInfoToInfoList(std::unique_ptr<PodInfo> podinfo)
// {