Commit Graph

16 Commits

Author SHA1 Message Date
Ivan Josipovic
70b6386441 feat(KubernetesJson): Use of SourceGenerationContext outside AOT (#1677)
* feat: initial source gen for json

* wip

* chore: readd default settings

* chore: cleanup

* chore: remove source gen from classic as it depends on C#9 support

* Update KubernetesClient.Classic.csproj

* wip

* enable UseStringEnumConverter

* chore: make converters public so we can use them in our libraries

* fix: recursion and remove converter from source gen

* fix: V1StatusObjectViewConverter

* wip

* wip

* wip

* fix: rfc3339 json serialization and yaml de/serialization

* chore: add namespace

* fix: imports

* fix: switch output to RFC3339Micro to fit Time and MicroTime

* chore: update AOT to match KubernetesYaml

* fix aot

* Update buildtest.yaml
2025-10-25 23:39:34 -07:00
Boshi Lian
5de1c25cf1 migrate to record (#1665)
* migrate to record

* chore: update project files and clean up unused references

* refactor: convert classes to records and simplify constructors for IntOrString, ResourceQuantity, and V1Patch

* fix: define IsExternalInit to resolve CS0518 error in IntOrString

* refactor: change IntOrString and ResourceQuantity from records to structs, update implicit conversions, and simplify null checks

* refactor: add JsonPropertyName attribute to Value property in IntOrString struct

* refactor: simplify V1Patch constructor and improve argument validation

* refactor: remove unnecessary CultureInfo parameter in ToInt method

* Update src/KubernetesClient/Models/ResourceQuantity.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/KubernetesClient/Models/IntOrString.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Revert "Update src/KubernetesClient/Models/ResourceQuantity.cs"

This reverts commit 62b20a691554659e28d419067220dc1a0620133b.

* refactor: remove commented-out formatting check and simplify build command

* refactor: remove IValidate.cs from project references in Aot and Classic

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-22 14:20:13 -07:00
Ivan Josipovic
885b9ae09d fix(yaml): byte[] serialization (#1657)
* fix(yaml): byte[] serialization

* fix: tests and code

* chore: add null check

* chore: add configmap tests
2025-09-05 12:17:25 -07:00
Ivan Josipovic
69afa49337 fix: yaml ByteArrayStringYamlConverter output new lines (#1651)
* fix: yaml byte[] output

* chore: fix styling

* chore: fix logic for single line values and add test
2025-08-27 15:15:16 -07:00
Boshi Lian
cca266e6ae Add CultureInfo.InvariantCulture to floating point number formatting (#1541)
* Add CultureInfo.InvariantCulture to floating point number formatting

* Remove unused using statement in KubernetesYamlTests.cs
2024-03-27 15:30:26 -07:00
Boshi Lian
f32cf9eab3 fix warnings for net8 (#1481)
* fix ca2007

* xUnit1031

* fix ca2007

* fix ca2007

* remove deprecated ctor

* fix xUnit1031

* fix missing doc

* fix missing dispose

* fix ex
2024-01-09 18:05:26 +01:00
Ivan Josipovic
d1ba0aae72 fix: yaml with merge (#1332)
* fix: yaml with merge

* chore: cleanup
2023-07-27 04:44:08 -07:00
stan-sz
16d3c010c2 Fix strict yaml parsing (#1061) 2022-10-21 11:57:40 -07:00
stan-sz
0b67950590 Provide strict k8s yaml model deserializer (#1047)
* Provide strict k8s yaml model deserializer

* Provide documentation

* Add UT coverage
2022-10-14 02:44:47 -07:00
Manuel Menegazzo
3702fd6e90 Standardization of using order and object initialization (#1028)
* Code cleanup KubernetesClient

* KubernetesClient.Basic code cleanup

* KubernetesClient.Models cleanup

* LibKubernetesGenerator code cleanup

* Improved readability of object initialization

* FIx namespace order

* Fixed some compilation warning
2022-09-28 13:34:32 -07:00
stan-sz
bbd3b6cd50 Support round-trip CRD (de)serialization (#1034)
* Support round-trip CRD (de)serialization

* Add a floating point emitter to fix UT

* Unused using

* Stylecop

* Reduce warnings
2022-09-27 01:01:51 -07:00
Manuel Menegazzo
f615b5b459 Fix some compilation warnings (#1010)
* Fixe some summary warning

* Fixed more warning

* Uniformed example projects code

* Uniformed test projects code

* Fix OperatingSystems enum and GenericType summaries
2022-09-15 16:21:21 -07:00
Vitor Moreira
82497863e0 fix(StringQuotingEmitter): add missing patterns for double quoting (#957)
* fix(StringQuotingEmitter): add missing patterns to regex for double quotes to be applied when serializing

* added missing bool patterns, updated unit test

* added bool spec 1.1 url as a comment to StringQuotingEmitter
2022-07-21 11:09:55 -07:00
Moim HA
6f323d82fd Added KubernetesYaml.SerializeAll method (#947) 2022-07-13 10:07:37 -07:00
Zhiwei Liu
4db390f3af fix obsolete warning about KubernetesYaml (#839) 2022-04-22 15:17:36 -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