Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several enhancements and fixes to the
UnleashReconciler
in thecontrollers/unleash_controller.go
file. The most significant changes include adding a deployment readiness check, refactoring error handling, and updating the test suite to cover new functionalities.Enhancements and Fixes:
Deployment Readiness Check:
deploymentTimeout
and a functionwaitForDeployment
to ensure the deployment rollout is complete before proceeding. (controllers/unleash_controller.go
) [1] [2] [3]getDeployment
,setDeploymentStatusFailed
, andsetDeploymentStatusAvailable
to facilitate deployment status checks in tests. (controllers/unleash_controller_test.go
) [1] [2] [3]Error Handling:
Reconcile
function to use a more consistent variable namestatusErr
for status update errors. (controllers/unleash_controller.go
) [1] [2] [3] [4]Test Suite Updates:
controllers/unleash_controller_test.go
) [1] [2]TestDeploymentIsReady
function to validate the deployment readiness utility. (pkg/utils/k8s_test.go
)Utility Enhancements:
DeploymentIsReady
function to theutils
package for checking deployment readiness. (pkg/utils/k8s.go
)Imports:
controllers/unleash_controller.go
andpkg/utils/k8s.go
. [1] [2] [3] [4]Close #193