Пример #1
0
 private void Load(bool reload)
 {
     if (reload)
     {
         Data = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
     }
     try
     {
         var configMaps = _client.ListNamespacedConfigMap(_namespaceSelector, labelSelector: _labelSelector);
         var dataList   = configMaps.Items.Where(w => w.Data != null).Select(s => s.Data);
         foreach (var dataItem in dataList)
         {
             foreach (var(key, value) in dataItem)
             {
                 Data[key.Replace(_separator, ":")] = value;
             }
         }
     }
     catch
     {
         // ignored
     }
 }