Use value from ContextDetails to populate Namespace (#373)
* Use value from ContextDetails to populate Namespace This is a fix for: #372 This change uses the value from ContextDetails.Namespace to populate KubernetesClientConfiguration.Namespace. The issue is there's a Namespace property on both Context and ContextDetails - The property on Context is used today - The property on ContextDetails is not - The property on ContextDetails maps to the actual yaml config * Obsolete Context.Namespace This property doesn't map to anything in the YAML and thus will never be set. Other clients I checked (java, golang) don't look for a property at this level. I think this was likely a mistake, and it should be obsoleted because it will never be populated. Example: ```yaml contexts: - context: cluster: ... namespace: ... # this is ContextDetails.Namespace user: ... name: foo ``` ```yaml contexts: - context: cluster: ... namespace: ... user: ... name: foo namespace: ... # this is Context.Namespace ```
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
namespace k8s.KubeConfigModels
|
||||
{
|
||||
using System;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
/// <summary>
|
||||
@@ -19,6 +20,7 @@ namespace k8s.KubeConfigModels
|
||||
[YamlMember(Alias = "name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Obsolete("This property is not set by the YAML config. Use ContextDetails.Namespace instead.")]
|
||||
[YamlMember(Alias = "namespace")]
|
||||
public string Namespace { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user