You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request introduces changes to improve type consistency,
enhance test coverage, and refactor the `Handler` method in the
`OperatorGenerator` class for better dependency injection. Below is a
summary of the most important changes:
### Type Consistency Improvements:
* Changed the `Labels` property in `KustomizationConfig` from
`KustomizationCommonLabels?` to an array type
`KustomizationCommonLabels[]?` to allow multiple labels.
(`src/KubeOps.Abstractions/Kustomize/KustomizationConfig.cs`)
* Updated the `Labels` assignment in the `Handler` method to use array
initialization syntax for consistency with the new type.
(`src/KubeOps.Cli/Commands/Generator/OperatorGenerator.cs`)
### Refactoring for Dependency Injection:
* Refactored the `Handler` method in `OperatorGenerator` to inject
`IAnsiConsole` as a parameter instead of directly using
`AnsiConsole.Console`. This improves testability and decouples the
method from the static console instance.
(`src/KubeOps.Cli/Commands/Generator/OperatorGenerator.cs`)
[[1]](diffhunk://#diff-cf95f5a9676479797ff0ade11e4dd8d679dd1974142058976f3a35ca6a63b4f2L39-R45)
[[2]](diffhunk://#diff-cf95f5a9676479797ff0ade11e4dd8d679dd1974142058976f3a35ca6a63b4f2L54-R62)
[[3]](diffhunk://#diff-cf95f5a9676479797ff0ade11e4dd8d679dd1974142058976f3a35ca6a63b4f2L74-R109)
[[4]](diffhunk://#diff-cf95f5a9676479797ff0ade11e4dd8d679dd1974142058976f3a35ca6a63b4f2L159-R159)
[[5]](diffhunk://#diff-cf95f5a9676479797ff0ade11e4dd8d679dd1974142058976f3a35ca6a63b4f2L170-R174)
### Test Coverage Enhancements:
* Added a new integration test
`Should_Generate_Valid_Installers_In_Cluster` to validate the generated
Kubernetes YAML files and ensure the presence of a valid
`kustomization.yaml` file.
(`test/KubeOps.Cli.Test/Management/Install.Integration.Test.cs`)
* Improved test dependencies by including `FluentAssertions` for better
assertions and validation in test cases.
(`test/KubeOps.Cli.Test/Management/Install.Integration.Test.cs`)
These changes improve the maintainability, testability, and
functionality of the codebase.
---------
Co-authored-by: Christoph Bühler <[email protected]>
0 commit comments