Exemple #1
0
 private void Load(bool reload)
 {
     if (reload)
     {
         Data = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
     }
     try
     {
         var secrets  = _client.ListNamespacedSecret(_namespaceSelector, labelSelector: _labelSelector);
         var dataList = secrets.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, ":")] = _decodeData ? DecodeSecret(value) : Encoding.UTF8.GetString(value);
             }
         }
     }
     catch
     {
         // ignored
     }
 }