Commit Graph

401 Commits

Author SHA1 Message Date
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
AshenW0lf
9e4ea2743e Update LICENSE (#604)
* Update LICENSE

Update the copyright notice within the licence agreement, as per the instructions under "APPENDIX: How to apply the Apache License to your work."

* Update LICENSE

Updated the date and licence holder for the copyright notice
2021-04-23 18:49:14 -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
Boshi Lian
f827736bf1 fix nuget build (#601) 2021-04-08 07:56:57 -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
Ali Kanso
0e3cb942d1 Custom Resource example (#540)
* CR example

* minor changes
2020-12-19 08:26:25 -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
a614d9584e move integration test to minikube proj (#526)
* move integrate test to minikube proj

* fix format
2020-11-25 08:16:39 -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
Brendan Burns
8003ab0ee8 Create codeql-analysis.yml (#519)
* Create codeql-analysis.yml

* fix pull.

* Update codeql-analysis.yml

* Create global.json
2020-11-18 17:26:50 -08:00
Boshi Lian
b636eb4597 Update nuget.yaml (#522) 2020-11-18 08:30:06 -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
af7be8603a E2E test with minikube on gh action (#513)
* add minikube as e2e test server

* fix format

* update env

* force no skip

* fix then

* finish skip test

* add skip blocker

* fix path

* output skipped case

* enable test env var

* final merge

* add missing file
2020-11-01 12:30:51 -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