ADD: added name to KubePod and added the possibility to pass a shared pointer to start a pod
This commit is contained in:
@@ -136,9 +136,19 @@ namespace kubecontrol
|
||||
return this->Component_;
|
||||
}
|
||||
|
||||
void KubePod::setName(std::string name)
|
||||
{
|
||||
this->Name_ = name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::string KubePod::getName()
|
||||
{
|
||||
return this->Name_;
|
||||
}
|
||||
|
||||
|
||||
std::string KubePod::createYAML()
|
||||
{
|
||||
YAML::Node node;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <list>
|
||||
#include <curlpp/Options.hpp>
|
||||
#include <sstream>
|
||||
#include <yaml-cpp/yaml.h>
|
||||
|
||||
#include <loguru.hpp>
|
||||
|
||||
|
||||
@@ -50,6 +50,18 @@ namespace kubecontrol
|
||||
// LOG_S(INFO)<<response;
|
||||
}
|
||||
|
||||
|
||||
void PodController::startPod(std::shared_ptr<KubePod> Pod,bool WaitTillRunning )
|
||||
{
|
||||
LOG_S(INFO)<< "starting pod: "<<Pod->getUUID();
|
||||
// auto response = Pod.start(ServerAddress_+ApiCall_, BearerToken_,WaitTillRunning);
|
||||
auto response = Pod->start(APIInterface_,WaitTillRunning);
|
||||
|
||||
std::lock_guard<std::mutex>lock(mx_);
|
||||
PodList_.emplace_back(std::make_unique<KubePod>(std::move(*Pod)));
|
||||
}
|
||||
|
||||
|
||||
void PodController::stopPod(std::string uuid)
|
||||
{
|
||||
std::lock_guard<std::mutex>lock(mx_);
|
||||
|
||||
Reference in New Issue
Block a user