diff --git a/CMakeLists.txt b/CMakeLists.txt index 6feee4d..c8b0781 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,10 @@ ENDIF() include/kubecontrol/PodInfo.hpp src/kubecontrol/PodInfo.cpp + + + include/kubecontrol/KubernetesAPI.hpp + src/kubecontrol/KubernetesAPI.cpp ) diff --git a/include/kubecontrol/KubePod.hpp b/include/kubecontrol/KubePod.hpp index b79269f..d58522a 100644 --- a/include/kubecontrol/KubePod.hpp +++ b/include/kubecontrol/KubePod.hpp @@ -1,5 +1,6 @@ #pragma once +#include "kubecontrol/KubernetesAPI.hpp" #include "kubecontrol/PodInfo.hpp" #include "nlohmann/json_fwd.hpp" #include "yaml-cpp/node/node.h" @@ -45,16 +46,36 @@ namespace kubecontrol std::string getComponent(); - std::string createYAML(); - std::string start(std::string apiAddress,std::string token); + + // [[deprecated("replace with start(KubernetesAPI APIInterface)")]] + // std::string start(std::string apiAddress,std::string token,bool WaitTillRunning = true); + + std::string start(KubernetesAPI APIInterface,bool WaitTillRunning = true); + + [[deprecated("replace with stop(KubernetesAPI APIInterface)")]] std::string stop(std::string apiAddress,std::string token); - std::string getInfo(std::string apiAddress,std::string token); + + std::string stop(KubernetesAPI APIInterface); + + // [[deprecated("replace with getInfo(KubernetesAPI APIInterface)")]] + // std::string getInfo(std::string apiAddress,std::string token); + + std::string getInfoForThisPod(KubernetesAPI APIInterface); + + std::string getInfoForRelatedPods(KubernetesAPI APIInterface); + + std::vector getUUIDForRelatedPods(KubernetesAPI APIInterface); + + PodInfo InfoPod; private: + + + std::string Owner_; std::string Uuid_; std::string Component_; @@ -63,6 +84,10 @@ namespace kubecontrol std::string PathToYaml_; std::string Namespace_; + std::string Ip_; + std::string Status_; + std::string PartOf_; + std::vector uuidsOfShildContainers; std::string PodCommand_; @@ -71,9 +96,12 @@ namespace kubecontrol std::map EnvirmonentVars_; std::vector Args_; + std::string createYAML(); + + // std::string read; - std::string StopChilds(std::string apiAddress,std::string token,std::string uuid); + std::string StopChilds(std::string apiAddress,std::string token,std::string uuid); }; } \ No newline at end of file diff --git a/include/kubecontrol/KubernetesAPI.hpp b/include/kubecontrol/KubernetesAPI.hpp new file mode 100644 index 0000000..ba75777 --- /dev/null +++ b/include/kubecontrol/KubernetesAPI.hpp @@ -0,0 +1,32 @@ +#pragma once +#include +#include + + +namespace kubecontrol +{ + +class KubernetesAPI +{ + public: + KubernetesAPI(); + KubernetesAPI(YAML::Node config); + + KubernetesAPI(std::string APIAddress, std::string Token); + + std::string performRequest(std::string request,std::string Methode = "GET"); + + std::string performRequest(std::string request,std::string Methode,std::string PostFields); + + void addAddress(std::string address); + void addToken(std::string Token); + void addYaml(YAML::Node config); + private: + std::string APIAddress_; + std::string Token_; + std::string Namespace_; + +}; + + +} \ No newline at end of file diff --git a/include/kubecontrol/PodController.hpp b/include/kubecontrol/PodController.hpp index d9a48d4..222e887 100644 --- a/include/kubecontrol/PodController.hpp +++ b/include/kubecontrol/PodController.hpp @@ -1,4 +1,5 @@ #pragma once +#include "kubecontrol/KubernetesAPI.hpp" #include "kubecontrol/PodInfo.hpp" #include #include @@ -16,13 +17,13 @@ namespace kubecontrol std::string getServerAddress(); - void startPod(KubePod Pod); - void stopPod(std::string Label); + void startPod(KubePod Pod,bool WaitTillRunning = true ); + void stopPod(std::string uuid); void stopAllPods(); - std::string getPodsInfo(); - std::string getInfoForOwnPod(); - std::string getInfoForPod(std::string Label); + std::string getInfoForAllPods(); + // std::string getInfoForOwnPod(); + std::string getInfoForPod(std::string uuid); size_t getListOfChildPods(); void checkPodsHierarchy(); @@ -30,6 +31,7 @@ namespace kubecontrol std::string getPodsInfoForAll(); std::shared_ptr getPodsInfo(std::string uuid); private: + KubernetesAPI APIInterface_; std::vector PodList_; std::string performRequest(std::string url); diff --git a/src/kubecontrol/KubePod.cpp b/src/kubecontrol/KubePod.cpp index e18a0fc..892391b 100644 --- a/src/kubecontrol/KubePod.cpp +++ b/src/kubecontrol/KubePod.cpp @@ -1,6 +1,9 @@ #include "curlpp/Options.hpp" +#include "kubecontrol/PodInfo.hpp" #include "kubecontrol/Utils.hpp" +#include "nlohmann/json_fwd.hpp" #include "yaml-cpp/binary.h" +#include #include #include #include @@ -170,7 +173,7 @@ namespace kubecontrol node["spec"]["containers"][0]["command"].push_back(PodCommand_); } - node["spec"]["terminationGracePeriodSeconds"] = 3; + node["spec"]["terminationGracePeriodSeconds"] = 10; node["spec"]["restartPolicy"] = "Never"; @@ -185,62 +188,43 @@ namespace kubecontrol } - std::string KubePod::start(std::string apiAddress,std::string token) + + + std::string KubePod::start(KubernetesAPI APIInterface,bool WaitTillRunning) { - std::string curlURL = apiAddress; - std::string AuthString = "Authorization: Bearer " + token; - - std::list headers; - headers.push_back(AuthString); - headers.push_back("Content-Type: application/yaml"); - - - curlpp::Cleanup cleaner; - curlpp::Easy request; - - std::stringstream result; - request.setOpt(cURLpp::Options::WriteStream(&result)); - - request.setOpt(new curlpp::options::HttpHeader(headers)); - - request.setOpt(new curlpp::options::Url(curlURL)); - - request.setOpt(new curlpp::options::SslVerifyPeer(false)); - - // request.setOpt(new curlpp::options::Post(true)); - request.setOpt(new curlpp::options::CustomRequest("POST")); - // request.setOpt(new curlpp::options::Verbose("POST")); + std::string request = "/api/v1/namespaces/simulator/pods/"; this->createYAML(); - LOG_S(INFO)<< this->PathToYaml_; + // LOG_S(INFO)<< this->PathToYaml_; std::stringstream stream; stream << YAMLNode_; - // request.setOpt(new curlpp::options::PostFields(buffer)); - request.setOpt(new curlpp::options::PostFields(stream.str())); + std::string response = APIInterface.performRequest(request,"POST",stream.str()); - - request.perform(); - - request.reset(); - std::string response = result.str(); InfoPod.update(response); - while (InfoPod.Status != "Running" && InfoPod.Status != "Succeeded") { - - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - response = this->getInfo(curlURL, token); - - InfoPod.update(response); - - } + if (WaitTillRunning == true) { - return response; + while (InfoPod.Status != "Running" && InfoPod.Status != "Succeeded") { + + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + response = this->getInfoForThisPod(APIInterface); + + InfoPod.update(response); + + } + } + + return response; } + + std::string KubePod::stop(std::string apiAddress,std::string token) { std::string curlURL = apiAddress+ this->Uuid_; + LOG_S(INFO)< headers; @@ -267,12 +251,20 @@ namespace kubecontrol request.perform(); auto response = result.str(); - LOG_S(INFO)<getInfo(apiAddress, token)); + + LOG_S(INFO)<<"Related pods: " < 0) { for(int i = 0; igetInfoForRelatedPods(APIInterface); + + return result; + + } + + std::string KubePod::StopChilds(std::string apiAddress,std::string token,std::string uuid) { std::string curlURL = apiAddress+ uuid; @@ -316,34 +321,88 @@ namespace kubecontrol - std::string KubePod::getInfo(std::string apiAddress,std::string token) - { - std::string curlURL = apiAddress+Uuid_+"/"+"status"; - std::string AuthString = "Authorization: Bearer " + token; - - std::list headers; - headers.push_back(AuthString); + // std::string KubePod::getInfo(std::string apiAddress,std::string token) + // { + // std::string curlURL = apiAddress+Uuid_+"/"+"status"; + // std::string AuthString = "Authorization: Bearer " + token; + + // std::list headers; + // headers.push_back(AuthString); - curlpp::Cleanup cleaner; - curlpp::Easy request; + // curlpp::Cleanup cleaner; + // curlpp::Easy request; - std::stringstream result; - request.setOpt(cURLpp::Options::WriteStream(&result)); + // std::stringstream result; + // request.setOpt(cURLpp::Options::WriteStream(&result)); - request.setOpt(new curlpp::options::HttpHeader(headers)); + // request.setOpt(new curlpp::options::HttpHeader(headers)); - request.setOpt(new curlpp::options::Url(curlURL)); + // request.setOpt(new curlpp::options::Url(curlURL)); - request.setOpt(new curlpp::options::SslVerifyPeer(false)); - + // request.setOpt(new curlpp::options::SslVerifyPeer(false)); - request.perform(); - return result.str(); + + // request.perform(); + // return result.str(); + // } + + std::string KubePod::getInfoForThisPod(KubernetesAPI APIInterface) + { + std::string request = "/api/v1/namespaces/simulator/pods/"+Uuid_+"/status"; + std::string result = APIInterface.performRequest(request,"GET"); + + return result; } + std::string KubePod::getInfoForRelatedPods( KubernetesAPI APIInterface) + { + // std::string curlURL = apiAddress+"?labelSelector=app.kubernetes.io/part-of="+Uuid_; + std::string request = "/api/v1/namespaces/simulator/pods?labelSelector=app.kubernetes.io/part-of="+Uuid_; + std::string result = APIInterface.performRequest(request,"GET"); + + return result; + } + + + std::vector KubePod::getUUIDForRelatedPods(KubernetesAPI APIInterface) + { + std::vector uuids; + + auto rawResponse = getInfoForRelatedPods(APIInterface); + + if (rawResponse == "") + { + return uuids; + } + + try { + nlohmann::json j = nlohmann::json::parse(rawResponse); + if (j.contains("items") && j["items"].is_array()) + { + for (auto i : j["items"]) + { + uuids.push_back(i["metadata"]["name"].get()); + } + } + } catch (const std::exception e) { + LOG_S(ERROR)<< "Exeption in getUUIDForRelatedPods() :" << e.what(); + } + + // LOG_S(INFO)< +#include +#include +#include +#include +#include +#include + +#include + + + + +namespace kubecontrol { + + KubernetesAPI::KubernetesAPI() + { + + } + + + KubernetesAPI::KubernetesAPI(YAML::Node config) + { + addYaml(config); + } + + + KubernetesAPI::KubernetesAPI(std::string APIAddress, std::string Token) + :APIAddress_(APIAddress), Token_(Token) + { + + } + + + void KubernetesAPI::addAddress(std::string address) + { + APIAddress_ = address; + } + void KubernetesAPI::addToken(std::string token) + { + Token_ = token; + } + void KubernetesAPI::addYaml(YAML::Node config) + { + try { + + Token_ = config["users"][0]["user"]["token"].as(); + Namespace_ = config["contexts"][0]["context"]["namespace"].as(); + + char * KUBERNETES_SERVICE_HOST = std::getenv("KUBERNETES_SERVICE_HOST"); + char * KUBERNETES_SERVICE_PORT = std::getenv("KUBERNETES_SERVICE_PORT"); + + if (KUBERNETES_SERVICE_HOST != nullptr && KUBERNETES_SERVICE_PORT!= nullptr) + { + APIAddress_ = "https://" +std::string(KUBERNETES_SERVICE_HOST)+":"+std::string(KUBERNETES_SERVICE_PORT); + } else + { + LOG_S(INFO)<<"Taking Serveraddress out of the provided YAML file"; + + APIAddress_ = config["clusters"][0]["cluster"]["server"].as(); + } + + } catch (std::exception& e) { + LOG_S(ERROR)<< e.what(); + throw e.what(); + } + } + + std::string KubernetesAPI::performRequest(std::string request,std::string Methode ) + { + std::stringstream result; + + std::string curlURL = APIAddress_+request; + std::string AuthString = "Authorization: Bearer " + Token_; + + std::list headers; + headers.push_back(AuthString); + + + curlpp::Cleanup cleaner; + curlpp::Easy curlRequest; + + curlRequest.setOpt(cURLpp::Options::WriteStream(&result)); + + + curlRequest.setOpt(new curlpp::options::HttpHeader(headers)); + + curlRequest.setOpt(new curlpp::options::Url(curlURL)); + + curlRequest.setOpt(new curlpp::options::SslVerifyPeer(false)); + curlRequest.setOpt(new curlpp::options::CustomRequest(Methode)); + + + try { + curlRequest.perform(); + + } catch (const std::exception e) { + LOG_S(ERROR)< headers; + headers.push_back(AuthString); + headers.push_back("Content-Type: application/yaml"); + + + curlpp::Cleanup cleaner; + curlpp::Easy curlRequest; + + std::stringstream result; + curlRequest.setOpt(cURLpp::Options::WriteStream(&result)); + + curlRequest.setOpt(new curlpp::options::HttpHeader(headers)); + + curlRequest.setOpt(new curlpp::options::Url(curlURL)); + + curlRequest.setOpt(new curlpp::options::SslVerifyPeer(false)); + + curlRequest.setOpt(new curlpp::options::CustomRequest("POST")); + + curlRequest.setOpt(new curlpp::options::PostFields(PostFields)); + + + curlRequest.perform(); + + curlRequest.reset(); + + + return result.str(); + + } +} \ No newline at end of file diff --git a/src/kubecontrol/PodController.cpp b/src/kubecontrol/PodController.cpp index 15a38ac..1faee5b 100644 --- a/src/kubecontrol/PodController.cpp +++ b/src/kubecontrol/PodController.cpp @@ -1,5 +1,7 @@ #include "curlpp/Options.hpp" +#include "kubecontrol/KubePod.hpp" +#include "kubecontrol/KubernetesAPI.hpp" #include "kubecontrol/PodInfo.hpp" #include "nlohmann/json_fwd.hpp" #include @@ -8,13 +10,15 @@ #include #include #include +#include #include #include namespace kubecontrol { - PodController::PodController(std::string pathToKubectlConfig) + PodController::PodController(std::string pathToKubectlConfig): + APIInterface_( YAML::LoadFile(pathToKubectlConfig)) { LOG_S(INFO)<< "Path To Yaml: " <(); } + ApiCall_ = "/api/v1/namespaces/"+Namespace_+"/pods/"; } catch (std::exception& e) { - LOG_S(ERROR)<< e.what(); - throw e.what(); + LOG_S(ERROR)<< e.what(); + throw e.what(); } } @@ -51,22 +56,32 @@ namespace kubecontrol - void PodController::startPod(KubePod Pod) + void PodController::startPod(KubePod Pod,bool WaitTillRunning ) { - PodList_.emplace_back(Pod); - LOG_S(INFO)<< "starting pod: "<lock(mx_); + PodList_.emplace_back(Pod); // LOG_S(INFO)<lock(mx_); + // PodList_ + for (std::vector::iterator it = PodList_.begin(); it != PodList_.end();) { - if (Label == item.getUUID()) + if (Label == it->getUUID()) { - item.stop(ServerAddress_+ApiCall_, BearerToken_); + it->stop(APIInterface_); + it = PodList_.erase(it); + } + else + { + it++; } } @@ -74,30 +89,34 @@ namespace kubecontrol void PodController::stopAllPods() { + std::lock_guardlock(mx_); + checkPodsHierarchy(); for (auto item : PodList_) { LOG_S(INFO)<getPodsInfo(); + auto response = this->getInfoForAllPods(); nlohmann::json j; try diff --git a/src/kubecontrol/PodInfo.cpp b/src/kubecontrol/PodInfo.cpp index a77f9c3..01cc04a 100644 --- a/src/kubecontrol/PodInfo.cpp +++ b/src/kubecontrol/PodInfo.cpp @@ -84,6 +84,11 @@ namespace kubecontrol j["Ip"] = Ip; j["Status"] = Status; j["Part-Of"] = PartOf; + j["Related-Pods"] ; + for (auto i : this->relatedPods ) { + j["Related-Pods"].push_back(i); + } + return j; } diff --git a/tests/test_KubePod.cpp b/tests/test_KubePod.cpp index 6731f09..b1665e9 100644 --- a/tests/test_KubePod.cpp +++ b/tests/test_KubePod.cpp @@ -1,3 +1,4 @@ +#include "kubecontrol/KubernetesAPI.hpp" #define CATCH_CONFIG_MAIN #include #include @@ -12,21 +13,41 @@ SCENARIO("Testing the SimCore Sensor") GIVEN("different Attributes for a Track in different forms") { - std::string api = "https://192.168.3.11:6443/api/v1/namespaces/simulator/pods/"; - std::string token = "eyJhbGciOiJSUzI1NiIsImtpZCI6Il9tUkVrVkp5VjFKeDhtV2xDTmM4R2Y1ZkhRSlBOOWxaVnhKTkZuWVlJamMifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJzaW11bGF0b3IiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlY3JldC5uYW1lIjoic2ltLXNlY3JldCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJzaW11bGF0b3IiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiJlOGU5YzQ2ZS1lMzcxLTQxMTItOTgzYS1lNzM5NGJmNWE0YzEiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6c2ltdWxhdG9yOnNpbXVsYXRvciJ9.JJjzj0RCU6PJruXuyrK_mNdW4piDADXKPtEW9YP2x1R57uhTDPFfG6LPMFbZTNyeI-A7A7bmjjAt0ICJDuLeL69J8ig3TS-i54R_PB--wFr-7jZMhnNz2wueyPuXxGiIuX-36H9rZ1cA-Dgt2qtDMNhK0TvOlgwUFU_cRjb2W0NhSvH8uB0qtIqOCyVzapCVwXWinyJPGiPL3ph8VxSo6P0ZDa4UjMJ_D6IlMpUpuHriKPLjGnDwTh2oJBjMFOmC_E0Mnr6Sd0rxzsIjIeG_ST6KqoPwyCTX27CPmO74CJUguLgFXSBOjuzvxon8KRYG6VJhRawEDnTU0zx6XrPXIQ"; + // std::string api = "https://192.168.3.11:6443/api/v1/namespaces/simulator/pods/"; + // std::string token = "eyJhbGciOiJSUzI1NiIsImtpZCI6Il9tUkVrVkp5VjFKeDhtV2xDTmM4R2Y1ZkhRSlBOOWxaVnhKTkZuWVlJamMifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJzaW11bGF0b3IiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlY3JldC5uYW1lIjoic2ltLXNlY3JldCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJzaW11bGF0b3IiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiJlOGU5YzQ2ZS1lMzcxLTQxMTItOTgzYS1lNzM5NGJmNWE0YzEiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6c2ltdWxhdG9yOnNpbXVsYXRvciJ9.JJjzj0RCU6PJruXuyrK_mNdW4piDADXKPtEW9YP2x1R57uhTDPFfG6LPMFbZTNyeI-A7A7bmjjAt0ICJDuLeL69J8ig3TS-i54R_PB--wFr-7jZMhnNz2wueyPuXxGiIuX-36H9rZ1cA-Dgt2qtDMNhK0TvOlgwUFU_cRjb2W0NhSvH8uB0qtIqOCyVzapCVwXWinyJPGiPL3ph8VxSo6P0ZDa4UjMJ_D6IlMpUpuHriKPLjGnDwTh2oJBjMFOmC_E0Mnr6Sd0rxzsIjIeG_ST6KqoPwyCTX27CPmO74CJUguLgFXSBOjuzvxon8KRYG6VJhRawEDnTU0zx6XrPXIQ"; + kubecontrol::KubernetesAPI KubeAPI(YAML::LoadFile("docs/config")); auto guid = xg::newGuid(); std::string uuid = guid.str(); // int random = rand() % 100 + 1; // std::string uuid = "random" + std::to_string(random); - kubecontrol::KubePod pod1("debug-debian",uuid,"debugdebianhenry:0.1.3"); - pod1.setEnvironmentVar("OWN_SHIP_SERVER", "127.0.0.1"); - LOG_S(INFO)< #include +#include +#include + #define CATCH_CONFIG_MAIN #include #include #include -void startShip(kubecontrol::PodController* podc,std::string Name, std::string lat, std::string lon) +void startShip(kubecontrol::PodController* podc,std::string uuid,std::string Name, std::string lat, std::string lon) { -std::string uuid = xg::newGuid().str(); kubecontrol::KubePod ShipPod1("controller",uuid,"ship","ship:latest","simulator"); nlohmann::json vars; @@ -36,14 +39,14 @@ std::string uuid = xg::newGuid().str(); podc->startPod(ShipPod1); } -void createScenario(kubecontrol::PodController* podc) +void createScenario(kubecontrol::PodController* podc,std::vector *uuidList) { // GeographicLib::Geodesic geod(GeographicLib::Constants::WGS84_a(), GeographicLib::Constants::WGS84_f()); double lat = 54, lon = 1; int counter = 0; double distance = 10000; - int rasterSize = 2; + int rasterSize = 5; for (int i = 0; i < rasterSize; i++ ) { @@ -58,8 +61,10 @@ void createScenario(kubecontrol::PodController* podc) lat2= lat+10; // SimCore::Identifier id; // ids->push_back(id.getUUID()); - - startShip( podc,name, std::to_string(lat2), std::to_string(lon2)); + std::string uuid = xg::newGuid().str(); + uuidList->push_back(uuid); + // startShip( podc,uuid,name, std::to_string(lat2), std::to_string(lon2)); + auto retrurn = std::async(std::launch::async, &startShip,podc,uuid,name, std::to_string(lat2), std::to_string(lon2)); // SimCore::Position pos; // pos.setGeodesicPos(lat2, lon2, 0); @@ -86,13 +91,24 @@ SCENARIO("Testing the SimCore Sensor") { -kubecontrol::PodController podc("docs/config"); +// kubecontrol::PodController podc("docs/config"); +auto podc = new kubecontrol::PodController("docs/config"); +std::vector uuidList; -createScenario(&podc); +createScenario(podc, &uuidList); - std::this_thread::sleep_for(std::chrono::milliseconds(5000)); +LOG_S(INFO)<<"Amount Parent Pods: " << uuidList.size(); +std::this_thread::sleep_for(std::chrono::milliseconds(20000)); + // podc.stopPod(std::string Label) -podc.stopAllPods(); +for (auto i: uuidList) +{ + auto retrurn = std::async(std::launch::async, &kubecontrol::PodController::stopPod,podc,i); +} + +// std::this_thread::sleep_for(std::chrono::milliseconds(20000)); + +podc->stopAllPods(); GIVEN("different Attributes for a Track in different forms") { diff --git a/tests/test_podInfo.cpp b/tests/test_podInfo.cpp index a89700d..bd7b339 100644 --- a/tests/test_podInfo.cpp +++ b/tests/test_podInfo.cpp @@ -3,6 +3,7 @@ #include "kubecontrol/PodController.hpp" #include "nlohmann/json_fwd.hpp" +#include #define CATCH_CONFIG_MAIN #include #include @@ -10,11 +11,52 @@ SCENARIO("Testing the SimCore Sensor") { - kubecontrol::PodController podc("docs/config"); - podc.checkPodsHierarchy(); - auto tmp = podc.getInfoForPod("hamburg"); - LOG_S(INFO)<