Skip to content

Commit

Permalink
Update version of Kubernetes Client (dotnet#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotalik authored May 5, 2020
1 parent 60818e5 commit 1c7f770
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 25 deletions.
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ limitations under the License.

-------------------------------------------------------------------

KubernetesClient 1.6.11 - Apache-2.0
KubernetesClient 2.0.17 - Apache-2.0
(c) 2008 VeriSign, Inc.


Expand Down
1 change: 1 addition & 0 deletions eng/Signing.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<FileSignInfo Include="Bedrock.Framework.dll" CertificateName="3PartySHA2" />
<FileSignInfo Include="Elasticsearch.Net.dll" CertificateName="3PartySHA2" />
<FileSignInfo Include="FeatherHttp.dll" CertificateName="3PartySHA2" />
<FileSignInfo Include="Fractions.dll" CertificateName="3PartySHA2" />
<FileSignInfo Include="KubernetesClient.dll" CertificateName="3PartySHA2" />
<FileSignInfo Include="OpenTelemetry.dll" CertificateName="3PartySHA2" />
<FileSignInfo Include="OpenTelemetry.Api.dll" CertificateName="3PartySHA2" />
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Tye.Core/Microsoft.Tye.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="KubernetesClient" Version="1.6.11" />
<PackageReference Include="KubernetesClient" Version="2.0.17" />
<!--
The Microsoft.Build.Locator package takes care of dynamically loading these assemblies
at runtime. We don't need/want to ship them, just to have them as references.
Expand Down
11 changes: 3 additions & 8 deletions src/Microsoft.Tye.Core/ValidateIngressStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,8 @@ public override async Task ExecuteAsync(OutputContext output, ApplicationBuilder
output.WriteDebugLine($"Validating ingress class '{ingressClass}'.");
var config = KubernetesClientConfiguration.BuildDefaultConfig();

// Workaround for https://github.com/kubernetes-client/csharp/issues/372
var store = await KubernetesClientConfiguration.LoadKubeConfigAsync();
var context = store.Contexts.Where(c => c.Name == config.CurrentContext).FirstOrDefault();

// Use namespace of application, or current context, or 'default'
config.Namespace = application.Namespace;
config.Namespace ??= context?.ContextDetails?.Namespace ?? "default";
// If namespace is null, set it to default
config.Namespace ??= "default";

var kubernetes = new Kubernetes(config);

Expand Down Expand Up @@ -110,7 +105,7 @@ public override async Task ExecuteAsync(OutputContext output, ApplicationBuilder

output.WriteAlwaysLine(
"Tye can deploy the ingress-nginx controller for you. This will be a basic deployment suitable for " +
"experimentation and development. Your production needs, or requirments may differ depending on your Kubernetes distribution. " +
"experimentation and development. Your production needs, or requirements may differ depending on your Kubernetes distribution. " +
"See: https://aka.ms/tye/ingress for documentation.");
if (!output.Confirm($"Deploy ingress-nginx"))
{
Expand Down
9 changes: 2 additions & 7 deletions src/Microsoft.Tye.Core/ValidateSecretStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,8 @@ public override async Task ExecuteAsync(OutputContext output, ApplicationBuilder

var config = KubernetesClientConfiguration.BuildDefaultConfig();

// Workaround for https://github.com/kubernetes-client/csharp/issues/372
var store = await KubernetesClientConfiguration.LoadKubeConfigAsync();
var context = store.Contexts.Where(c => c.Name == config.CurrentContext).FirstOrDefault();

// Use namespace of application, or current context, or 'default'
config.Namespace = application.Namespace;
config.Namespace ??= context?.ContextDetails?.Namespace ?? "default";
// If namespace is null, set it to default
config.Namespace ??= "default";

var kubernetes = new Kubernetes(config);

Expand Down
11 changes: 3 additions & 8 deletions src/tye/UndeployHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,11 @@ public static async Task ExecuteUndeployAsync(OutputContext output, ConfigApplic
{
var config = KubernetesClientConfiguration.BuildDefaultConfig();

// Workaround for https://github.com/kubernetes-client/csharp/issues/372
var store = await KubernetesClientConfiguration.LoadKubeConfigAsync();
var context = store.Contexts.Where(c => c.Name == config.CurrentContext).FirstOrDefault();

// Use namespace of application, or current context, or 'default'
config.Namespace = application.Namespace;
config.Namespace ??= context?.ContextDetails?.Namespace ?? "default";

var kubernetes = new Kubernetes(config);

// If namespace is null, set it to default
config.Namespace ??= "default";

// Due to some limitations in the k8s SDK we currently have a hardcoded list of resource
// types that we handle deletes for. If we start adding extensibility for the *kinds* of
// k8s resources we create, or the ability to deploy additional files along with the
Expand Down

0 comments on commit 1c7f770

Please sign in to comment.