/// <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)); }
/// <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; }
/// <summary> /// Loads or reloads the Kubernetes configuration. /// </summary> /// <returns>The <see cref="Config"/>.</returns> public static KubeConfig LoadConfig() { cachedConfig = null; return(Config); }