ADD: added new config file and added a debug message in podcontroller constructor

This commit is contained in:
Henry Winkel
2023-09-27 13:04:21 +02:00
parent 570b4557db
commit 2779eb1be3
2 changed files with 15 additions and 7 deletions

View File

@@ -5,6 +5,7 @@
#include <cstdlib>
#include <exception>
#include <kubecontrol/PodController.hpp>
#include <math.h>
#include <memory>
#include <string>
#include <vector>
@@ -14,7 +15,10 @@ namespace kubecontrol
{
PodController::PodController(std::string pathToKubectlConfig)
{
YAML::Node config = YAML::LoadFile(pathToKubectlConfig);
LOG_S(INFO)<< "Path To Yaml: " <<pathToKubectlConfig;
try {
YAML::Node config = YAML::LoadFile(pathToKubectlConfig);
BearerToken_ = config["users"][0]["user"]["token"].as<std::string>();
@@ -32,6 +36,10 @@ namespace kubecontrol
}
ApiCall_ = "/api/v1/namespaces/hwinkel/pods/";
} catch (std::exception& e) {
LOG_S(ERROR)<< e.what();
throw e.what();
}
}
std::string PodController::getServerAddress()