2023-11-12 09:07:23 +00:00
|
|
|
|
namespace KubernetesWorkflow.Recipe
|
2023-08-07 13:51:44 +00:00
|
|
|
|
{
|
|
|
|
|
public class PodLabels
|
|
|
|
|
{
|
|
|
|
|
private readonly Dictionary<string, string> labels = new Dictionary<string, string>();
|
|
|
|
|
|
2023-09-04 07:08:34 +00:00
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
2023-09-04 07:08:34 +00:00
|
|
|
|
public PodLabels Clone()
|
2023-08-10 09:25:22 +00:00
|
|
|
|
{
|
2023-09-04 07:08:34 +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
|
|
|
|
}
|
|
|
|
|
|
2023-09-04 07:08:34 +00:00
|
|
|
|
public void Clear()
|
2023-08-07 13:51:44 +00:00
|
|
|
|
{
|
2023-09-04 07:08:34 +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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|