ADD: added container class and adapted test

This commit is contained in:
Henry Winkel
2024-03-14 09:46:37 +01:00
parent 37627a16ca
commit b645005aeb
11 changed files with 219 additions and 70 deletions

View File

@@ -0,0 +1,75 @@
#pragma once
#include <map>
#include <string>
#include <utility>
#include <kubecontrol/Utils.hpp>
#include <yaml-cpp/yaml.h>
namespace kubecontrol
{
class Container
{
public:
/**
* @brief Construct a new Container object
*
* @param Owner
* @param Uuid
* @param ContainerImage
*/
Container(const std::string &Owner, const std::string &Uuid,const std::string &Image, const PullPolicy &policy, const std::string &registry = "kmaster.ti.unibw-hamburg.de:30808");
/**
* @brief adds env to container
*
* @param env
*/
void addEnv(const std::pair<std::string, std::string> &env);
/**
* @brief add map of envs
*
* @param envs
*/
void addEnv(const std::map<std::string, std::string> &envs);
/**
* @brief Get the Owner
*
* @return
*/
std::string getOwner() { return owner_;};
/**
* @brief get the uuid
*
* @return
*/
std::string getUUID() { return uuid_;};
/**
* @brief Get the Image
*
* @return
*/
std::string getImage() { return image_;};
YAML::Node toYAML();
private:
std::string owner_;
std::string uuid_;
std::string image_;
std::string registry_;
PullPolicy pullPolicy_;
std::map<std::string, std::string> envs_;
};
}