Skip to content

Adds support for loading a string config content in KubernetesClientConfiguration #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

allantargino
Copy link
Contributor

Hi guys,

fixes #82
As related on the mentioned issue, we needed this feature in order to don't create temp files in our server.

Does the changes I've made make sense?

Thanks

@tg123
Copy link
Member

tg123 commented Jan 18, 2018

LGTM

but I suggest support stream if string is supported
string, file would just be syntax sugar of stream

@allantargino
Copy link
Contributor Author

Hey @tg123, that's a great suggestion, this way we can support multiple ingress cases.

Great thanks to @ViniciusSouza who authored the changes and commit it.

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file should not be checked in

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've created a NuGet package with those changes and I have let it there by mistake.
fixed, by removing the folder.

@@ -11,6 +11,10 @@

<TargetFramework>netstandard1.4</TargetFramework>
<RootNamespace>k8s</RootNamespace>
<Version>1.1.0</Version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what those properties for?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've created a NuGet package with those changes and I have let it there by mistake.
Fixed

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageVersion>0.2.0-beta</PackageVersion>
<PackageVersion>0.2.1-beta</PackageVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe should be managed by @brendandburns

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've created a NuGet package with those changes and I have let it there by mistake.
Fixed

/// <returns>Instance of the <see cref="K8SConfiguration"/> class</returns>
private static K8SConfiguration LoadKubeConfig(Stream kubeconfig)
{
StreamReader sr = new StreamReader(kubeconfig);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

return k8SConfiguration;
}

private static KubernetesClientConfiguration GetKubernetesClientConfiguration(ref string currentContext, string masterUrl, K8SConfiguration k8SConfig)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why ref?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visual Studio´s refactoring.. fixed.

@brendandburns
Copy link
Contributor

brendandburns commented Jan 26, 2018

I'm happy to merge this once @tg123 's comments are addressed.

@allantargino
Copy link
Contributor Author

allantargino commented Jan 26, 2018

@tg123 and @brendandburns, all fixed!

@brendandburns
Copy link
Contributor

LGTM, @tg123 any more comments?

@tg123
Copy link
Member

tg123 commented Jan 27, 2018

LGTM. better to do a squash merge

@allantargino allantargino force-pushed the allantargino/config-string branch from 2c32f51 to d24a72b Compare January 27, 2018 16:22
@allantargino
Copy link
Contributor Author

Squashed 👍

@brendandburns
Copy link
Contributor

Thanks, merging.

@brendandburns brendandburns merged commit a5f0e06 into kubernetes-client:master Feb 1, 2018
@brendandburns
Copy link
Contributor

@tg123 fwiw, github now supports "squash and merge" so there's no need for the author to squash...

JonJam pushed a commit to JonJam/csharp that referenced this pull request Sep 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KubernetesClientConfiguration could support loading from string
4 participants