Exemple #1
0
        /// <summary>
        /// Rewrites the local kubeconfig file.
        /// </summary>
        /// <param name="config">The new configuration.</param>
        public static void SetConfig(KubeConfig config)
        {
            Covenant.Requires <ArgumentNullException>(config != null);

            cachedConfig = config;

            WriteFileTextWithRetry(KubeConfigPath, NeonHelper.YamlSerialize(config));
        }
Exemple #2
0
 /// <summary>
 /// Clears all cached items.
 /// </summary>
 private static void ClearCachedItems()
 {
     cachedConfig             = null;
     cachedContext            = null;
     cachedHeadendClient      = null;
     cachedNeonKubeUserFolder = null;
     cachedKubeUserFolder     = null;
     cachedRunFolder          = null;
     cachedLogFolder          = null;
     cachedClustersFolder     = null;
     cachedPasswordsFolder    = null;
     cachedCacheFolder        = null;
     cachedDesktopFolder      = null;
     cachedClientConfig       = null;
     cachedClusterCertificate = null;
     cachedProgramFolder      = null;
     cachedPwshPath           = null;
 }
Exemple #3
0
 /// <summary>
 /// Loads or reloads the Kubernetes configuration.
 /// </summary>
 /// <returns>The <see cref="Config"/>.</returns>
 public static KubeConfig LoadConfig()
 {
     cachedConfig = null;
     return(Config);
 }