Commit Graph

360 Commits

Author SHA1 Message Date
Andy Kernahan
e90be77e42 Fix nuget's "Setup SxS dotnet" not being run. (#401) 2020-04-06 05:25:33 -07:00
Andy Kernahan
944622dd65 Upgrade to .NET Core SDK 3.1. (#395)
* Upgrade to .NET Core SDK 3.1.

* Add workaround for setup-dotnet not supporting SxS dotnet installs.

* Specify explicit fetch depth of 0 for Nerdbank.GitVersioning.

* Make step names consistent across workflows.

* Coerce robocopy's exit code when it does not indicate an error.

* Make robocopy as quiet as possible.
2020-04-06 02:51:48 -07:00
Nicholas Steicke
3164e9234c introduce CreateWatchHandle for use with HttpClientFactory (#379) 2020-04-05 21:27:46 -07:00
Tyler Jensen
4e1c9bd20c Test exception type expected for .NET Standard 2.0 (#389)
* different exception type expected for 2.0

* remove net452 as tests cannot run for Framework

* Eliminate build target in test. Use common type.
2020-04-03 13:21:51 -07:00
Andy Kernahan
3e94068d43 Improve Watcher thread utilisation. (#386)
* Add Watcher constructor overload which accepts the more general TextReader.

* Make CancelableStream delegate the async methods to the inner stream.

* Make CancelableStream dispose of the inner stream.

* Make PeekableStreamReader a decorator enabling direct delegation to the inner's asynchronous methods.

* Make CancelableStream.Flush respect the cancellation token.

* Rename CancellationTokenSourceSlim -> LinkedCancellationTokenSource.

* Specify 7.3 language version.
2020-03-31 19:45:27 -07:00
Tyler Jensen
ddb4b21aeb Remove dupe null check (#384) 2020-03-25 14:45:41 -07:00
Andrew Stakhov
c48fc0dc56 Add interfaces for generated Kubernetes objects (#378)
* Add interfaces for generated Kubernetes objects that can allow working with them without using concrete types. This work is needed for future shared informers / controllers components being developed

* Add metadata for plural names. This opens up a path for many generic  operations as plural name is needed to construct path
2020-03-22 21:22:45 -07:00
Boshi Lian
40026e40a5 update source link to release (#377) 2020-03-22 21:20:45 -07:00
Boshi Lian
d55a333bed fix watch=true doesn't respect cancellation token (#376)
* fix watch=true doesn't respect cancellation token

* use exp body where can

* address comments
2020-03-22 21:18:45 -07:00
Andy Kernahan
3e6815ad4c Ensure that awaits do not continue on the captured context. (#370)
* Ensure that awaits do not continue on the captured context.

* Make functions async for maintainability.

* Add documentation detailing the use of UIFact.
2020-03-18 21:54:44 -07:00
Boshi Lian
af741302de fix watch generator uses different name pattern from gen project (#369)
* fix watch generator uses different name pattern from gen project

* run generator to refresh bad files

* fix npe when not x-kind
2020-03-17 13:57:26 -07:00
Ryan Nowak
da3bff5b3e 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
```
2020-03-17 09:48:23 -07:00
Boshi Lian
c1bab3caed following up after switching to gh action (#367)
* disable az pipeline

* disable ci coverage report

* do test before push

* remove push nuget from travis

* fix coverage ignore
2020-03-13 21:58:34 -07:00
Boshi Lian
c8de0ca263 Introduce githuh action (#364)
* gh build and test

* fix dotnet env

* fix DisposeWatch test fickle

* mini 0??

* nuget push from gh
2020-03-10 15:19:57 -07:00
Boshi Lian
7749ae07c8 revert move fraction internal (#366) 2020-03-10 15:19:37 -07:00
Boshi Lian
0468a66de4 fix DisposeWatch test fickle (#365) 2020-03-09 14:35:36 -07:00
Boshi Lian
435ab5cd15 [breaking changes] cleanup targets (#361)
* remove target xamarin ios and android (supported by netstandard)

* remove 1.4

* build warning cleared

* remove bom

* fix ci failed
2020-03-08 15:57:34 -07:00
Kubernetes Prow Robot
b07e78afa4 Out-of-tree client authentication providers (UserCredentials exec option) for asp.net core applications (#359)
* Adding the user credentials exec abillity
	new file:   src/KubernetesClient/KubeConfigModels/ExecCredentialResponse.cs
	new file:   src/KubernetesClient/KubeConfigModels/ExternalExecution.cs
	modified:   src/KubernetesClient/KubeConfigModels/UserCredentials.cs
	modified:   src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs

* Fixed a few issues with the process spawning and some null references issues

* Removed unused import that caused the build to fail (Mail)

* Added preprocessor directive that will disable out-of-tree client authentication in case it is not a asp.net core app

* Added tests to the new external execution (out-of-tree client authentication) extension

* Trying to fix failing tests that fail apparently due to the preprocessor symbol

* Trying to fix failing macos tests

* Added the -n (do not output trailing newline) and the -E options to the echo command in OSX

* initializing arguments variable

* Changes according to tg123 comments
Changed OSX testing command to printf to try and solve the JSON
parsing errors

* Added missing references

* Environment.UserInteractive and Process applies to .NET Standard >= 2.0 according to Microsoft documentation
2020-03-05 09:12:38 -08:00
Pragya Mehta
e11cc58e56 Upgrade Microsoft.AspNetCore.WebUtilities to 2.2.0 for netstandard2.0 (#358)
* Upgrade Microsoft.AspNetCore.WebUtilities to 2.2.0 for netstandard2.0 and netcoreapp2.1

* Mking the change only for netstandard2.0
2020-02-13 16:50:18 -08:00
Brendan Burns
ba9755b626 Improve async config loading. (#353) 2020-02-09 13:17:53 -08:00
Leonardo
fa515869e2 Updated Nerdbank.GitVersioning to 3.0.5 (#350)
The old version had an issue with Mono on MacOSX which caused the build to fail. Now the build flows flawlessly
2020-01-22 16:34:49 -08:00
jurgyy
5ecbfc24f6 File.Open changed to File.OpenRead (#348) 2020-01-21 00:51:36 -08:00
Brendan Burns
67be97e74b Add a loadAll to load multiple objects from a single YAML. (and tests) (#344) 2020-01-10 13:59:37 -08:00
Brandon Sharp
3a30033090 Prevent NullReferenceException when using HttpClient to initialize Kubernetes client. Fixes #335 (#336)
* Preventing null ref exception when initializing with HttpClient and adding support for generating a default client handler from a config object

* Updating example to make use of config-based client handler generation
2020-01-06 21:28:17 -08:00
David Robson
3c3c6cab91 Use Path.DirectorySeparatorChar to have ServiceAccountPath start from root, instead of a relative path. (#342)
This should work fine on Linux containers, but it still assumes the Windows container working drive is "C:"
2020-01-06 12:44:16 -08:00
Boshi Lian
03491df7fa Update test.yaml (#337) 2019-12-20 21:41:33 -08:00
Brendan Burns
06380095b4 Remove forward slashes from paths. (#323) 2019-12-19 16:45:32 -08:00
idubnori
f67aaec566 Fix - Not applied patch if path contains Uppercase (#330)
* Add JsonPatchTests

* Upgrade JsonPatch and Json.net, if netstandard2.0 or netcoreapp2.1
2019-12-05 17:42:49 -08:00
Brendan Burns
8a615c275a Add an exception for certs known not to work. (#322) 2019-11-21 20:29:28 -08:00
Brendan Burns
aadeb74af9 Add an initial github action. (#324)
* Add a new workflow.

* Update gitignore.
2019-11-08 22:03:39 -08:00
Boshi Lian
35f54a779f make windows happy (#314) 2019-10-22 16:04:12 -07:00
Boshi Lian
a95400bd50 watcher to support empty response (#313)
* Add a WatchAsync method.

* proposal for watcher async

* fix and add testcase for async watch

* try fix build
2019-10-22 16:02:13 -07:00
Boshi Lian
8ab95b6b92 gen v1.16.0 (#312)
* gen v1.16.0

* update version.json
2019-10-02 15:16:08 -07:00
Brendan Burns
d9bca19e77 Fix port-forward example (#309) 2019-09-30 00:53:38 -07:00
Brendan Burns
239125a85d Fix YAML serialization for IntOrString values. (#310) 2019-09-30 00:47:37 -07:00
David Parks
e00f67abd4 Add another couple of constructors to Fix #279 (#302)
* Add support for HttpClientFactory with KubernetesClientConfiguration

* Add an example with http client factory

* ensure sample uses the latest version of C#
2019-09-23 21:33:25 -07:00
Kumar Abhishek
fcd8c166da Merge pull request #287 from tg123/gen_v1.15.0
gen v1.15.0
2019-07-24 18:42:21 -07:00
Boshi Lian
e3e5ee9a41 fix build 2019-06-24 04:25:54 -07:00
Boshi Lian
d5074f8888 run generator again 2019-06-23 05:30:00 -07:00
Boshi LIAN
fe6a64351e update watch generator 2019-06-23 05:29:22 -07:00
Boshi Lian
3805988160 gen v1.15.0 2019-06-23 11:34:04 +00:00
Xin Yan
d6cb191be5 add websocket auth support for .net standard 2.0 support (#281)
* add websocket auth support for .net standard 2.0 support

* format file
2019-05-14 09:43:18 -07:00
Brendan Burns
e42916a316 Rev minikube version. (#283)
Also disable ubuntu build since it's broken.
2019-05-11 20:42:48 -07:00
Frederik Carlier
466e33995d Prototype Exec API (#271) 2019-04-01 14:18:34 -07:00
Boshi Lian
644cf76009 Gen v1.14.0 (#275)
* gen v1.14.0

* update watcher generator for 1.14
2019-03-28 11:51:58 -07:00
Boshi Lian
be4fa2489f Merge pull request #274 from qmfrederik/workarounds/disable-resharper
Temporarily disable the Resharper checks
2019-03-26 11:18:51 -07:00
Frederik Carlier
fad7cfe53f Temporarily disable the Resharper checks 2019-03-26 14:57:30 +01:00
Frederik Carlier
7b8a36c99e Add Linux & macOS leg to CI, add code coverage (#264) 2019-03-25 16:29:12 -07:00
Tom Kerkhove
a58f908685 Remove double "Usage" in docs (#270)
Remove double "Usage" in docs
2019-03-24 15:43:05 -07:00
Gaz Iqbal
fd1736f3e7 fixed KubernetesClientConfiguration.BuildConfigFromConfigFile not respecting the currentContext parameter (#269) 2019-03-22 17:00:09 -07:00