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>
This commit is contained in:
Boshi Lian
2025-09-22 14:20:13 -07:00
committed by GitHub
parent 96955064cb
commit 5de1c25cf1
34 changed files with 215 additions and 454 deletions

View File

@@ -172,27 +172,33 @@ namespace k8s.E2E
using var kubernetes = CreateClient();
await kubernetes.CoreV1.CreateNamespacedEventAsync(
new Corev1Event(
new V1ObjectReference(
"v1alpha1",
kind: "Test",
name: "test",
namespaceProperty: "default",
resourceVersion: "1",
uid: "1"),
new V1ObjectMeta()
new Corev1Event
{
InvolvedObject = new V1ObjectReference
{
ApiVersion = "v1alpha1",
Kind = "Test",
Name = "test",
NamespaceProperty = "default",
ResourceVersion = "1",
Uid = "1",
},
Metadata = new V1ObjectMeta
{
GenerateName = "started-",
},
action: "STARTED",
type: "Normal",
reason: "STARTED",
message: "Started",
eventTime: DateTime.Now,
firstTimestamp: DateTime.Now,
lastTimestamp: DateTime.Now,
reportingComponent: "37",
reportingInstance: "38"), "default").ConfigureAwait(false);
Action = "STARTED",
Type = "Normal",
Reason = "STARTED",
Message = "Started",
EventTime = DateTime.Now,
FirstTimestamp = DateTime.Now,
LastTimestamp = DateTime.Now,
ReportingComponent = "37",
ReportingInstance = "38",
},
"default"
).ConfigureAwait(false);
}
[MinikubeFact]