cs-codex-dist-tests/Framework/KubernetesWorkflow/Recipe/PodLabels.cs

30 lines
687 B
C#
Raw Permalink Normal View History

namespace KubernetesWorkflow.Recipe
2023-08-07 13:51:44 +00:00
{
public class PodLabels
{
private readonly Dictionary<string, string> labels = new Dictionary<string, string>();
public void Add(string key, string value)
2023-08-10 09:25:22 +00:00
{
2023-09-15 10:25:10 +00:00
labels.Add(key, K8sNameUtils.Format(value));
2023-08-10 09:25:22 +00:00
}
public PodLabels Clone()
2023-08-10 09:25:22 +00:00
{
var result = new PodLabels();
foreach (var entry in labels) result.Add(entry.Key, entry.Value);
return result;
2023-08-10 09:25:22 +00:00
}
public void Clear()
2023-08-07 13:51:44 +00:00
{
labels.Clear();
2023-08-17 09:06:45 +00:00
}
2023-08-07 13:51:44 +00:00
internal Dictionary<string, string> GetLabels()
{
return labels;
}
}
}