revert change to structs from classes for IntOrString and ResourceQuantity, and handle null values in YAML converters#1673
Conversation
…and handle null values in YAML converters
There was a problem hiding this comment.
Pull Request Overview
This PR reverts IntOrString and ResourceQuantity from struct to class types and adds null safety handling in their YAML converters. The changes address issue #1672 which likely involved null reference exceptions when using these types.
- Converts IntOrString and ResourceQuantity from structs back to classes
- Adds null-safe handling in YAML converters with conditional operators
- Includes a comprehensive E2E test for V2 Horizontal Pod Autoscaler functionality
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/KubernetesClient/Models/IntOrString.cs | Reverted from struct to class and added null safety in implicit string conversion |
| src/KubernetesClient/Models/ResourceQuantity.cs | Reverted from struct to class |
| src/KubernetesClient/Models/IntOrStringYamlConverter.cs | Added null-conditional operator for safe YAML serialization |
| src/KubernetesClient/Models/ResourceQuantityYamlConverter.cs | Added null-conditional operator for safe YAML serialization |
| tests/E2E.Tests/MinikubeTests.cs | Added comprehensive E2E test for V2HorizontalPodAutoscaler operations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, tg123 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
this fix #1672