2018-09-27 10:50:39 -07:00
|
|
|
namespace k8s.KubeConfigModels
|
|
|
|
|
{
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using YamlDotNet.Serialization;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2018-02-16 07:32:59 +01:00
|
|
|
/// kubeconfig configuration model. Holds the information needed to build connect to remote
|
2018-09-27 10:50:39 -07:00
|
|
|
/// Kubernetes clusters as a given user.
|
2018-02-16 07:32:59 +01:00
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Should be kept in sync with https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/client-go/tools/clientcmd/api/v1/types.go
|
2018-09-27 10:50:39 -07:00
|
|
|
/// </remarks>
|
|
|
|
|
public class K8SConfiguration
|
2018-02-16 07:32:59 +01:00
|
|
|
{
|
2018-09-27 10:50:39 -07:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets general information to be use for CLI interactions
|
|
|
|
|
/// </summary>
|
|
|
|
|
[YamlMember(Alias = "preferences")]
|
|
|
|
|
public IDictionary<string, object> Preferences{ get; set; }
|
|
|
|
|
|
|
|
|
|
[YamlMember(Alias = "apiVersion")]
|
|
|
|
|
public string ApiVersion { get; set; }
|
|
|
|
|
|
|
|
|
|
[YamlMember(Alias = "kind")]
|
|
|
|
|
public string Kind { get; set; }
|
2018-02-16 07:32:59 +01:00
|
|
|
|
2018-09-27 10:50:39 -07:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the name of the context that you would like to use by default.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[YamlMember(Alias = "current-context", ApplyNamingConventions = false)]
|
|
|
|
|
public string CurrentContext { get; set; }
|
2018-02-16 07:32:59 +01:00
|
|
|
|
2018-09-27 10:50:39 -07:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a map of referencable names to context configs.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[YamlMember(Alias = "contexts")]
|
|
|
|
|
public IEnumerable<Context> Contexts { get; set; } = new Context[0];
|
2018-02-16 07:32:59 +01:00
|
|
|
|
2018-09-27 10:50:39 -07:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a map of referencable names to cluster configs.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[YamlMember(Alias = "clusters")]
|
|
|
|
|
public IEnumerable<Cluster> Clusters { get; set; } = new Cluster[0];
|
2018-02-16 07:32:59 +01:00
|
|
|
|
2018-09-27 10:50:39 -07:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a map of referencable names to user configs
|
|
|
|
|
/// </summary>
|
|
|
|
|
[YamlMember(Alias = "users")]
|
2018-02-16 07:32:59 +01:00
|
|
|
public IEnumerable<User> Users { get; set; } = new User[0];
|
|
|
|
|
|
2018-09-27 10:50:39 -07:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets additional information. This is useful for extenders so that reads and writes don't clobber unknown fields.
|
2018-02-16 07:32:59 +01:00
|
|
|
/// </summary>
|
|
|
|
|
[YamlMember(Alias = "extensions")]
|
2018-04-27 06:13:48 +02:00
|
|
|
public IDictionary<string, dynamic> Extensions { get; set; }
|
|
|
|
|
|
2018-09-27 10:50:39 -07:00
|
|
|
/// <summary>
|
2018-04-27 06:13:48 +02:00
|
|
|
/// Gets or sets the name of the Kubernetes configuration file. This property is set only when the configuration
|
2018-09-27 10:50:39 -07:00
|
|
|
/// was loaded from disk, and can be used to resolve relative paths.
|
2018-04-27 06:13:48 +02:00
|
|
|
/// </summary>
|
|
|
|
|
[YamlIgnore]
|
2018-09-27 10:50:39 -07:00
|
|
|
public string FileName { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|