pulumi / pulumi-kubernetes-operator

A Kubernetes Operator that automates the deployment of Pulumi Stacks
Apache License 2.0
222 stars 55 forks source link

[V2] Clean up utils file #708

Closed rquitales closed 2 weeks ago

rquitales commented 2 weeks ago

Proposed changes

This PR removes the custom min and max functions for the time.Duration type. Go v1.21 introduced built-in functions so we can rely on them. This PR also adds a simple test case for the existing exactlyOneOf function.

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 49.37%. Comparing base (096b846) to head (d0d0956). Report is 1 commits behind head on v2.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## v2 #708 +/- ## ========================================== + Coverage 49.23% 49.37% +0.13% ========================================== Files 26 26 Lines 2890 2882 -8 ========================================== Hits 1423 1423 + Misses 1290 1284 -6 + Partials 177 175 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rquitales commented 2 weeks ago

Were the min/max functions not being used in the stack controller?

min and max are used in the reconcile function to determine the requeue after time: https://github.com/pulumi/pulumi-kubernetes-operator/blob/096b8462db56324347cbb04a967705b898d75824/operator/internal/controller/pulumi/stack_controller.go#L705-L713