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