PodLabels.cs
1 namespace KubernetesWorkflow.Recipe 2 { 3 public class PodLabels 4 { 5 private readonly Dictionary<string, string> labels = new Dictionary<string, string>(); 6 7 public void Add(string key, string value) 8 { 9 labels.Add(key, K8sNameUtils.Format(value)); 10 } 11 12 public PodLabels Clone() 13 { 14 var result = new PodLabels(); 15 foreach (var entry in labels) result.Add(entry.Key, entry.Value); 16 return result; 17 } 18 19 public void Clear() 20 { 21 labels.Clear(); 22 } 23 24 internal Dictionary<string, string> GetLabels() 25 { 26 return labels; 27 } 28 } 29 }