Commit Graph

444 Commits

Author SHA1 Message Date
Brendan Burns
8f4ee45cf3 Add environment variable checking for in cluster configs. (#766) 2022-02-01 10:41:42 -08:00
Weihan Li
6bed103992 AddRange extension enhancement (#771) 2022-01-31 12:08:19 -08:00
Boshi Lian
3278e8b418 eat There is no currently active test (#770) 2022-01-26 11:09:35 -08:00
Garima Negi
436eb0e173 Fix OWNERS file : reviewers (#769) 2022-01-23 16:08:15 -08:00
Max Horstmann
19d750c8bf Clean up NuGet workflow (#768)
* create release (disable nuget push for now)

* nudge

* skip tests

* use Powershell because Windows runner

* gh version outdated?

* try ubuntu?

* Revert "try ubuntu?"

This reverts commit ee256b1d4709e74e5ebd2d32842d47260616c320.

* install it via choco?

* different command

* Revert "different command"

This reverts commit 55f31bdb5d28f4acbf942c1db5fbdcfc412a8eca.

* ooh it just needs GITHUB_TOKEN

* clean up, add comment

* move further down

* re-enable everything

* indent

* fix RegEx so that it supports higher version numbers

* debug

* Revert "debug"

This reverts commit 243b8208277390f1369645162d214fb55efe3682.

* confirmed that cli is on latest now. clean this up.

* nudge

* skip tests

* disable push

* Revert "disable push"

This reverts commit 143978d9e44972a502da3e8504e085d31c7669c7.

* Revert "skip tests"

This reverts commit 4362d21534f29262977cf121f1cea934ad90ec03.
2022-01-23 01:50:20 -08:00
Max Horstmann
0e7ddae917 Automatically create a matching release for every NuGet version (#759)
* Automatically create a matching release for every NuGet version
2022-01-11 08:31:19 -08:00
Boshi Lian
250a45741e move all generated code to c# source generator (#756)
* remove the dependency of unprocessed swagger file

* all code generator

* good bye generated code

* remove generator cmd from sln

* eliminate generated folder

* fix multi target build

* disable dotnet fmt due to cannot load lib generator

* fix race

* fix race for multi target
2021-12-22 17:16:44 -08:00
Boshi Lian
1778d446d1 simplify http build code (#754)
* simplify request code

* re generate code

* remove unused tracing from websocket

* dotnet fmt

* fix warning

* fix warning

* make fmt and stylecop happy together
2021-12-19 09:01:26 -08:00
Boshi Lian
743e859889 source generators: (#753)
* introduce net5 source generator: version convert

* remove unused generator related files
2021-12-19 08:59:24 -08:00
Boshi Lian
eca9898902 API v1.23.0 + system.text.json + remove WatchXXX API (#750)
* gen v1.23.0

* fix converter

* bump ver

* update readme runtime

* fix warning

* update dep ver

* newtonjson -> system.text.json

* generate for new json api

* readme lf

* dotnet fmt

* dotnet fmt tests/

* dotnet fmt

* Revert "dotnet fmt"

This reverts commit e14c59076143fe2218ed899295a00762f0ea2bd6.

* fix err introduce by dotnet fmt

* fix test

* remove deprecated /watch api

* generate code after /watch removed

* remove /watch related code

* trim Microsoft.Rest.Serialization
2021-12-13 07:31:59 -08:00
Binyang2014
6c539873b5 Fix x-kubernetes-int-or-string in CRD can not be desterilized correctly. (#747)
* bug fix

* add ut
2021-12-03 10:00:29 -08:00
Boshi Lian
e45fa773ba add net6 targets (#745)
* add net6 targets

* move to net6 builtin format

* e2e target

* make codeql happy
2021-11-15 19:39:25 -08:00
Boshi Lian
f515fb4d76 add generic create (#744)
* add generic create

* flaky test on test env
2021-11-12 12:06:28 -08:00
David Dieruf
4ff1ea49b8 Ported GenericKubernetesApi from java along with other utilities (#682)
* Ported GenericKubernetesApi from java along with other utilities

* Replace DeleteOptions for V1DeleteOptions

* Clean up and add clear()

* Clean up

* Removed TweakApiHandler

* Rename methods to follow "async" pattern

* Fix method naming

* Remove unneeded json property

* Rearrange httpsuccess logic

* Simplify dispose pattern

* Treat MockKubeServerFlags as flags

* Clean up flags logic

* Remove unneeded json properties

* Fix cs formatting

* Remove unused variable

* Move MockApi server options to seperate class and revert MockApi back to original

* Remove IRunnable

* Refactor config constants to use existing service account path
2021-11-03 10:52:34 -07:00
Vladimir Khvostov
c23baaf3e8 Fixed bug in methods which hit "apis/{group}/..." url (#741)
* Moved _url.Replace("/apis//", "/api/") down several lines.

Consider the following code:
  var _baseUrl = BaseUri.AbsoluteUri;
  var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/namespaces/{namespace}/{plural}").ToString();
  _url = _url.Replace("/apis//", "/api/");
  _url = _url.Replace("{group}", group);
  _url = _url.Replace("{version}", version);
  _url = _url.Replace("{namespace}", namespaceParameter);
  _url = _url.Replace("{plural}", plural);

If group is empty string, we need to replace /apis// with /api.
To do this, we need to replace /apis// after {group}.
Code after the change:

   var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apis/{group}/{version}/namespaces/{namespace}/{plural}").ToString();
  _url = _url.Replace("{group}", group);
  _url = _url.Replace("{version}", version);
  _url = _url.Replace("{namespace}", namespaceParameter);
  _url = _url.Replace("{plural}", plural);
  _url = _url.Replace("/apis//", "/api/");

* Auto-generated changes
2021-11-02 12:41:32 -07:00
Boshi Lian
7a0248609d workaround for pem cert on windows (#738) 2021-10-26 14:57:10 -07:00
Boshi Lian
ae591580b6 fix build (#734)
* fix build

* eliminate warnings
2021-10-24 08:14:22 -07:00
Boshi Lian
3643250f40 use net5 certificate api instead of 3rd api (#733)
* use net api for cert loading

* codeql happy?
2021-10-20 06:57:58 -07:00
Vladimir Khvostov
e7de93dd10 Made a change to avoid calling _httpResponse.Content.ReadAsStringAsync() and deserialize from the content stream. (#731)
* Avoid calling _httpResponse.Content.ReadAsStringAsync() and deserialize from the content stream

Made a change to avoid calling _httpResponse.Content.ReadAsStringAsync() and deserialize from the content stream, which significantly reduced memory utilization.
Created Kubernetes.cs file and moved constructors and couple methods from the Kubernetes.cs.template to the Kubernetes.cs

Generated Kubernetes.cs will be in a separate commit.

* Separate commit for generated Kubernetes.cs
2021-10-20 06:55:58 -07:00
Boshi Lian
43f8922d20 Upgrade generator dep (#730)
* catch up nswag

* fix changes due to api change

* nustache as well
2021-10-20 06:53:59 -07:00
Frode Hus
73d8e99d2a Add missing client cert (#729)
* Updated GitVersioning package to fix issue with loading native libgit lib. Added check for missing HttpClientHandler

* fixed type

* HttpClientHandler is null when trying to get client certificates for web socket connection. Added direct configuration of client cert instead of via HttpClientHandler

* fixed indentation warning

* re-added certs from httpclienthandler if present

* Updated GitVersioning package to fix issue with loading native libgit lib. Added check for missing HttpClientHandler

* fixed type

* HttpClientHandler is null when trying to get client certificates for web socket connection. Added direct configuration of client cert instead of via HttpClientHandler

* fixed indentation warning

* re-added certs from httpclienthandler if present

* merged duplicate code

* reverted package changes
2021-10-20 06:51:58 -07:00
Bliamoh
2d8915dff7 Update customResource example + bump nuget packages versions (#720)
Update customResource example nuget packages + update example

Update httpClientFactory example nuget packages

Update nuget packages

Change DateTime to DateTimeOffset

Update tests nuget packages

Make KubernetesClient project reference instead of Nuget package reference

Co-authored-by: Boshi Lian <farmer1992@gmail.com>

Co-authored-by: Boshi Lian <farmer1992@gmail.com>
2021-10-14 09:02:51 -07:00
Boshi Lian
fb553c5c0d refactor generator code (#727)
* refactor generator code

* remove unused files

* dotnet fmt
2021-10-14 06:55:19 -07:00
Boshi Lian
bc11d3aec2 httpclient to support different timeout for watch and regular api (#725)
* api for httpclient timeout

* testcases for global timeout

* update timeout to honor token

* generated files
2021-10-11 12:55:02 -07:00
Boshi Lian
78387dc44f Fix 718 url not relative to baseuri (#724)
* trim starting / for api path

* regenerate with api path
2021-10-11 12:53:02 -07:00
Boshi Lian
6d90ddb722 add async foreach example (#715) 2021-09-29 15:34:44 -07:00
Boshi Lian
041f127136 add version matrix (#716) 2021-09-29 15:32:45 -07:00
Remi Gaudin
3f178a7b78 Upgrade Microsoft.Rest.ClientRuntime from 2.3.10 to 2.3.23 (#702)
* Upgrade Microsoft.Rest.ClientRuntime from 2.3.10 to 2.3.23 (#699)

* Fix unit tests by setting kubernetesMock.CallBase = true (#699)
2021-09-29 05:21:45 -07:00
Boshi Lian
463e2d94df Fix 712 (#713)
* fix iter obj validate might npe

* generated models
2021-09-24 19:34:21 -07:00
Boshi Lian
7bbf6aa374 Fix 710 (#711)
* fix template body not included

* new generated file

* trim unused ref
2021-09-21 15:48:48 -07:00
Boshi Lian
6eea70326d Inline tweak handler (#706)
* move tweak handler to template

* generated code

* remove handler from api
2021-09-17 08:23:01 -07:00
Boshi Lian
07ab21bb98 Fix log return disposed obj (#705)
* generator not to dispose stream

* new generated code

* test to cover log stream
2021-09-17 08:21:00 -07:00
Boshi Lian
4e29dff8d2 expose IAsyncEnumerable API for watcher (#586)
* support async enum watch

* honor ct and catch more exception

* fix format

* better flaky

* ct to for should throw

* make sure no npe

* fix nuget build

* fix watcher test

* check close before dispose
2021-09-17 08:19:01 -07:00
Boshi Lian
61025a0255 add implicit cast back (#696) 2021-09-14 11:22:04 -07:00
Boshi Lian
b9032960e9 Inline watcher (#681)
* ignore more files

* inline watcher

* remove watcher handler

* generated files

* mark LineSeparatedHttpContent internal

* method removed

* fix warning
2021-09-14 11:20:05 -07:00
Boshi Lian
d66c914c86 Gen v1.22.0 (#677)
* generator to support bool?

* gen v1.22.0

* trim version convertor

* bump ver
2021-08-15 09:01:46 -07:00
Boshi Lian
3b8d3beab4 fix build warning (#678) 2021-08-10 10:40:40 -07:00
Boshi Lian
b8f78e4641 port autorest2 template to local generate tools (#669)
* port autorest to watch generator

* rename KubernetesWatchGenerator -> KubernetesGenerator

* add validate

* fix format

* fix generate code warnings

* fix line ending

* fix missing property found by comp check

* do not new http method
2021-08-09 07:27:32 -07:00
Boshi Lian
72afeafe96 fix flaky leader election tests (#676)
* force max thread

* add log

* use countdown to sync

* add logs

* add thread
2021-08-09 07:25:32 -07:00
Grégory Poircuitte
86e339a7f7 Fix typos (#674) 2021-08-04 07:53:24 -07:00
David Dieruf
af53bf3cec Initial port of cache functions from java client (#665)
* Initial port of cache functions from java client

* Move lock in Cache.Replace to be less disruptive

* Remove IListerWatcher as it's not used at the moment

* Added todo in Cache.Get as reminder

* TApiType implement IKubernetesObject

* TApiType implement IKubernetesObject

* TApiType implement class along with IKubernetesObject

* Disable failing test until it can be figured out

* Ran `dotnet format --fix-whitespace --fix-style` to put formatting in compliance

* Moved contents of KubernetesClient.Util into KubernetesClient project

* Moved contents of KubernetesClient.Util into KubernetesClient project #2 :(
2021-08-04 07:51:25 -07:00
JHogue-80
0f0fc1a059 Fixed regex to quote strings with leading zeros (#667) 2021-07-21 18:05:51 -07:00
Weihan Li
f2d6d3c48a Makes realFileSystem readonly (#655)
Makes `realFileSystem` read-only since it would not be updated
2021-07-01 08:45:55 -07:00
Mike Norgate
11273fe42f fix leader election lease duration (#653)
* fix leader election lease duration

* fix cast
2021-06-27 06:58:51 -07:00
Boshi Lian
308a15f43c fix sec issue (#647)
* fix sec issue

* update oidc instead

* Revert "update oidc instead"

This reverts commit c19672cdb99569e090edfbd06148162e0569c68c.
2021-06-21 02:57:26 -07:00
Brendan Burns
762c8af640 Add support for loading namespaces from pod configuration. (#640) 2021-06-14 16:22:08 -07:00
Boshi Lian
d2fa4dee25 expose tonumber of ResourceQuantity (#639) 2021-05-26 07:15:22 -07:00
Jarrett Confrey
ac0f43b576 fix: oidc (#633)
* fix: oidc

* revert: verbose oidc logs

* fix: actually commit changes

* chore: cleanup var name

* chore: address pr feedback
2021-05-24 09:33:39 -07:00
Weihan Li
3ce35a74bf Update TokenFileAuth to use async read file method (#631)
Fix typo
Use async method to read file token
2021-05-21 09:36:10 -07:00
Weihan Li
29c460d0ed Public KubeConfigDefaultLocation (#635)
expose KubeConfigDefaultLocation so that user could use
2021-05-21 09:32:12 -07:00