Commit Graph

472 Commits

Author SHA1 Message Date
Boshi Lian
adbf587970 skip dup when push (#825) 2022-04-04 16:35:36 -07:00
Arzu Suleymanov
6ff5460812 Restart sts daemonset deployment example (#819)
* chore : csr approval example using json patch net package

* chore : use top level feature, remove k8s client and use reference instead

* chore : remove target framework

* fix : remove redundant reference package

* feat : implement restart sts, daemonset & deployment option using patch

* refactor : optimize code and resolve warnings
2022-04-04 16:19:36 -07:00
Boshi Lian
541a2f5630 support gh nuget (#817) 2022-04-04 11:28:11 -07:00
Boshi Lian
8575548cd9 Kubernetes.Classic: add support for netstandard2.0 and net48 (#808)
* support gh nuget (#11)

* trim to fit net48

* add net48 support

* add very test framework

* add test body

* Revert "support gh nuget (#11)"

This reverts commit 5cdaf59690170be44e4554485fb2e89785a6a1cf.
2022-04-03 16:35:42 -07:00
kibernetik542
92ccac423a chore : csr approval example using json patch net package (#816)
* chore : csr approval example using json patch net package

* chore : use top level feature, remove k8s client and use reference instead

* chore : remove target framework

* fix : remove redundant reference package
2022-04-01 15:08:33 -07:00
stan-sz
93c50b4948 Reuse const strings and expose PluralName (#811)
* Reuse const strings and expose PluralName

Both in ModelExtensions.cs

* Remove quotes
2022-03-29 13:01:38 -07:00
stan-sz
9e6e2f0baa Standardize TargetFramwork for VisualStudio IDE (#810)
* Follow up on unused using cleanup

* Revert

* Package upgrades

* LF

* Update README.md

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

Co-authored-by: Boshi Lian <farmer1992@gmail.com>
2022-03-29 13:01:26 -07:00
Boshi Lian
57037f0070 move kubectl config and yaml related to model module (#806)
* move yaml and config to models module

* better naming

* address comments
2022-03-28 16:57:12 -07:00
Boshi Lian
dba7b9718e move getheader to abstract (#807) 2022-03-28 08:45:23 -07:00
Boshi Lian
8e8619130a netstandard2 extendable lib model, basic rest (#793)
* first lib model

* add missing files

* happy test

* add vanilla rest for extend

* fix new url pattern

* address comments

* add v to tag

* bump ver

* add missing file when ren

* support multi pkg

* fix gh action

* fix env var

* ren title

* use gh action to set ver

* remove unused

* remove unused
2022-03-23 16:25:20 -07:00
Weihan Li
0f09a330bc Support for package icon file (#800) 2022-03-21 19:19:44 -07:00
stan-sz
624ee292f7 Enable some of the unnecessary code rules (#799)
* CA1823 Avoid unused private fields
* CA1847 Use string.Contains(char) instead of string.Contains(string) with single characters
* IDE0005 Remove unnecessary import
* IDE0051 Private member is unused
* IDE0052 Private member is unread
2022-03-21 19:17:45 -07:00
Boshi Lian
6f4c47963a add v to tag (#796) 2022-03-20 11:03:08 -07:00
Weihan Li
f69bf83b19 Code Enhancements (#794)
* Let private members readonly

* Use long.TryParse

* Sealed internal types

* Sealed private types
2022-03-08 11:40:00 -08:00
Boshi Lian
01b2aa832c cleanup folders (#792)
* unify folders

* move dep and target outside
2022-03-07 10:06:55 -08:00
Weihan Li
c11e205a01 Update System.Text.Json dependency (#791)
* Update System.Text.Json dependency

* Update System.Text.Json dependency condition
2022-02-27 22:35:34 -08:00
Weihan Li
acc7b4b09f HttpExtensions enhancement (#790) 2022-02-26 22:30:51 -08:00
Weihan Li
0a739fb46d Use Task.CompletedTask (#789) 2022-02-26 22:30:03 -08:00
Boshi Lian
341580fb9b fix Unable to process file command 'env' successfully. (#787) 2022-02-26 08:25:23 -08:00
Boshi Lian
e6ee874bf3 fix build warning (#786) 2022-02-25 13:35:22 -08:00
Boshi Lian
0d719f1fc6 7.1 remove old autorest (#785)
* init removal

* clean up warning

* bump ver to 7.1

* fix build

* custom http client no long supported

* cleanup unused types

* fix npe

* remove service client

* modern ssl settings

* fix test

* fix client cert null

* fix ctor

* cleanup
2022-02-25 13:33:23 -08:00
Boshi Lian
ef7d226ab0 update swagger gen readme (#783) 2022-02-25 13:31:24 -08:00
Boshi Lian
d49a3f09be new release strategy (#784)
* add draft

* nuget when release

* no release
2022-02-24 14:14:14 -08:00
Brendan Burns
2ad5b9613c Improve support for 'exec' credentials. (#774) 2022-02-23 09:32:19 -08:00
Boshi Lian
8a39035055 fix flaky logger (#782)
* fix flaky logger

* update env related dep

* build info
2022-02-20 14:34:10 -08:00
Zhiwei Liu
29f9aa9df4 Add http2 keep alive in watch (#781) 2022-02-17 01:18:45 -08:00
Boshi Lian
408610fce8 fix codeql (#780) 2022-02-15 15:37:18 -08:00
Zhiwei Liu
d74f357c9f Support .net 6 for tcp keep alive (#777) 2022-02-08 00:13:24 -08:00
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