Commit Graph

169 Commits

Author SHA1 Message Date
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
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
Alex Vincent
0b9d6a6dd6 fix nuget symbols (#626) 2021-05-19 10:46:31 -07:00
Namra Prajapati
09f08d7659 Adding two new properties in ExternalExecution model. (#620) 2021-05-14 15:57:58 -07:00
Boshi Lian
9bea20bd4f fix dateformat rejected (#611)
* fix dateformat rejected

* fix format

* fix format
2021-04-28 16:42:49 -07:00
Chad Jessup
2cbad3d429 Trimming double quote from parsed KUBECONFIG path. (#608)
Addresses #607 - trimming double quote when creating ```FileInfo```.
2021-04-20 11:04:34 -07:00
Boshi Lian
225bb1f59b Gen v1.21.0 (#603)
* gen v1.21.0

* update version converter

* bump version to 5

* remove support of netstandard2.0

* update test dependency
2021-04-09 13:37:17 -07:00
Brendan Burns
7d66489cb4 Add a Prometheus handler. (#591)
* Add a Prometheus handler.

* Address comments
2021-04-09 08:53:05 -07:00
Ali Alp
17a89f2939 documentation syntaxt issues resolved (#602) 2021-04-08 11:21:11 -07:00
Benjamin Burns
57aef03afe Default type map for YAML deserialization (#599)
* Affects Yaml.LoadAllFrom* methods
* Doesn't require user to explicitly pass a mapping for known types
* Allows user to specify a mapping for custom types, if required
2021-04-05 12:43:19 -07:00
Boshi Lian
edaeb1443a fix partial chain (#596) 2021-04-02 14:52:12 -07:00
Boshi Lian
59352954c4 force http2 in handler (#592) 2021-03-24 11:36:08 -07:00
Boshi Lian
c4d1f852a2 better tcpkeepalive on linux (#588)
* make a opt for user to control the tcp keep alive

* apply workaround for linux

* fix fmt
2021-03-18 09:17:19 -07:00
Boshi Lian
cb9ca20d93 fix typo V1PathJsonConverter -> V1PatchJsonConverter (#580) 2021-03-11 09:36:22 -08:00
Boshi Lian
1b831ecf78 add apply patch type (#579) 2021-03-11 09:34:22 -08:00
Boshi Lian
655a42c6bd add tcp keep alive hack to net5 target (#560)
* add tcp keep alive hack to net5 target

* remove unused code

* fix ep

* Update buildtest.yaml

* fix netstandard21

* fix space

* fix net5 warning

* more comment
2021-03-11 09:32:22 -08:00
Alex Meyer-Gleaves
d48e93c1f6 Support IgnoreUnmatchedProperties in YAML serialization (#574)
* Support IgnoreUnmatchedProperties in YAML serialization

* Remove unnecessary null-conditional operator
2021-03-02 12:35:20 -08:00
Alex Meyer-Gleaves
a4350d6c8f Fix ObjectDisposedException thrown when calling Yaml.LoadAllFromFileAsync (#573) 2021-02-26 23:21:43 -08:00
Boshi Lian
b282b9571b fix file not closed (#571) 2021-02-24 21:35:24 -08:00
Nick Kirby
a5614df8bc Fix typos (#565)
This PR contains small typo corrections
2021-02-19 11:57:50 -08:00
Frederik Carlier
7025d50562 Regenerate API (#564) 2021-02-18 08:40:51 -08:00
Boshi Lian
0ccf01b7bb remove always false (#561)
* remove always false

* remove unsupport format arg
2021-02-17 08:25:09 -08:00
Frederik Carlier
6acdac256d Make LineSeparatedHttpContent public (#549)
This allows the community to provide custom implementations of the Watch algorithm.
2021-02-01 15:28:28 -08:00
Frederik Carlier
4e58609159 Support wildcard IPv4 and IPv6 addresses (#550)
Some tools can generate kubeconfig files which use wildcard IPv4 or IPv6 addresses. For example, using k3d with --api-server=https://0.0.0.0:6433/ would generate a kubeconfig file like this:

```
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: (...)
    server: https://0.0.0.0:6433
  name: k3d-k3s-default
```

Standard Kubernetes tools (like kubectl or Helm) correctly parse the 0.0.0.0 IP address and transform it 127.0.0.1; 3rd party tools like curl or wget will do the same on Unix systems.

This is default behavior on Unix but not on Windows. As a result, the .NET Kubernetes client will fail to work with kubeconfig files like this and you'll get HTTP exceptions.

Go has explicit workarounds for this (see 1a0b1cca4c), and this PR attemps to replicate these workarounds in the .NET client.
2021-01-28 00:19:48 -08:00
Frederik Carlier
6f5706d753 Fix kubeconfig extension handling (#556)
Extensions on kubeconfig files are stored as a list of NamedExtension objects, not a dictionary.
2021-01-27 08:57:40 -08:00
Frederik Carlier
46d4eaa7d8 KubernetesException: Add an constructor overload which takes a V1Status and an inner exception. (#553) 2021-01-26 19:51:39 -08:00
Frederik Carlier
aeb3a0bcc6 Add HttpClient property to the IKubernetes interface (#548)
* Add HttpClient property to the Kubernetes interface

* PR feedback
2021-01-26 19:49:40 -08:00
arbielsk
143db15d03 OIDC support (#544)
* add minimal oidc support

* add OidcTokenProvider

* add null check for accessToken

* deal with missing client-secret in config

* fix formatting, typos

* remove commented line

* trigger github actions to check for non-deterministic test behavior

* Update src/KubernetesClient/Authentication/OidcTokenProvider.cs

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

* Update src/KubernetesClient/Authentication/OidcTokenProvider.cs

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

* cleanup

* add CA1723 to exceptions

* remove exception for CA1723, add CA1724 instead

Co-authored-by: Boshi Lian <farmer1992@gmail.com>
2021-01-19 14:07:59 -08:00
Boshi Lian
97ed40c5a8 fix delay (#543)
* fix delay ignored

* fix retry delay in ms

* fix retry delay in ms

* do not wait if timeout

* fix flasky test case

* delay to be timespan

* Revert "delay to be timespan"

This reverts commit 3a004b6a6904747fa5475adeadbf6e654082d809.
2021-01-08 09:10:55 -08:00
Boshi Lian
9a90881e31 leader election (#537)
* init leader leaderelection

* fix format

* remove unused import

* add config map

* fix space

* add multi lock

* lease lock

* cp case LeaderElection

* more test cases

* port all testcases from java

* fix space

* fix default timeout

* try to fix flasky  gh action by reducing renew deadline

* try debug failed gh action
2020-12-17 10:03:10 -08:00
Boshi Lian
c0e96f516b deprecate net452 + generate model based on v1.20.0 (#536)
* remove most net452 related code

* first net4 remove

* migrate test proj to net5 base

* fix format

* update sta xunit to fix platform not support

* Squashed commit of the following:

commit 16e1f819058ad281e1571b356c10d4d6ce77cf38
Author: Boshi Lian <farmer1992@gmail.com>
Date:   Tue Dec 8 22:42:57 2020 -0800

    temp disable some version converter

commit 7d1a651f4e7d27d1e61c91f46f73ac8d04ea8ab9
Author: Boshi Lian <farmer1992@gmail.com>
Date:   Tue Dec 8 20:55:44 2020 -0800

    add missing watcher generator files

commit 3f3199aad269bf89406ea71d0bc63f1a7ec23245
Author: Boshi Lian <farmer1992@gmail.com>
Date:   Tue Dec 8 22:14:47 2020 +0000

    gen v1.20.0

* bump version to 4.0

* support empty spec

* fix version converter for generator

* add generated header

* fix warning

* rerun generator
2020-12-13 19:55:27 -08:00
Boshi Lian
8bbf1476c2 add V1Patch for patch custom obj (#530) 2020-11-25 08:14:39 -08:00
Brendan Burns
3fd47e5644 Add an initial generic client. (#525) 2020-11-23 02:59:34 -08:00
Boshi Lian
5be3cff425 Style fix final (#523)
* all net5

* var

* SA1310

* SA1310

* allow 1031

* SA1805

* fix SA1642

* remove unused code

* allow sa1405

* isempty

* fix CA1714

* fix CA1806

* remove always false if

* fix format

* fix CA1062

* allow SA0001

* fix CA1062

* allow ca1034 and temp allow ca1835

* fix 16XX doc related warnings

* elm SA16XX

* elm SA16XX

* fix CA2213

* revert to pass all test

* move unclear rule to ruleset

* follow up of moving ruleset

* remove this

* fix test flaky
2020-11-22 14:52:09 -08:00
Boshi Lian
f59c13da0e Allow multi patch http content type header (#521)
* header from obj

* update git version mod

* remove json patch test

* test for json patch
2020-11-17 10:38:05 -08:00
Brendan Burns
e18ec35250 fix patch example. (#517) 2020-11-17 05:40:04 -08:00
Chris Smith
19854da0a1 overwrite existing external process environment variables to prevent throwing when a key is present that is already set (#520) 2020-11-13 08:32:25 -08:00
Boshi Lian
16845bae1d Style fix1 (#512)
* fix SA1505 and SA1508

* fix SA1116

* fix SA1009

* fix SA1019

* fix SA1127

* fix SA1128

* fix SA1134

* fix indent

* allow CA2227

* fix CA1810

* using clean up

* fix naming

* fix CA1806

* fix await

* Revert "fix CA1806"

This reverts commit a3b465087fdaf26ec461272373ee9810a90de2cc.

* fix dotnet format

* allow SA1009
2020-11-01 12:24:51 -08:00
Boshi Lian
82c8ae059f gen v1.19.3 (#511) 2020-10-30 10:00:09 -07:00
Brendan Burns
3772ffb838 Revert the change from json-patch to merge-patch (#506) 2020-10-27 22:29:56 -07:00