FIX:fixed issue where unecessary yaml args are set

This commit is contained in:
Henry Winkel
2023-08-09 10:30:41 +02:00
parent bda06c285b
commit 7669718bdd

View File

@@ -96,14 +96,21 @@ namespace kubecontrol
node["spec"]["containers"][0]["env"][i]["value"] = item.second;
}
node["spec"]["containers"][0]["args"].SetStyle(YAML::EmitterStyle::Flow);
if (Args_.size() > 0)
{
node["spec"]["containers"][0]["args"].SetStyle(YAML::EmitterStyle::Flow);
for (auto item : Args_) {
node["spec"]["containers"][0]["args"].push_back(item);
}
}
if (!PodCommand_.empty())
{
node["spec"]["containers"][0]["command"].SetStyle(YAML::EmitterStyle::Flow);
node["spec"]["containers"][0]["command"].push_back(PodCommand_);
}