Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for rollout #260

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Wait for rollout #260

wants to merge 1 commit into from

Conversation

Starefossen
Copy link
Member

@Starefossen Starefossen commented Dec 11, 2023

This pull request introduces several enhancements and fixes to the UnleashReconciler in the controllers/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:

  • Introduced a new constant deploymentTimeout and a function waitForDeployment to ensure the deployment rollout is complete before proceeding. (controllers/unleash_controller.go) [1] [2] [3]
  • Added utility functions getDeployment, setDeploymentStatusFailed, and setDeploymentStatusAvailable to facilitate deployment status checks in tests. (controllers/unleash_controller_test.go) [1] [2] [3]

Error Handling:

  • Refactored error handling in the Reconcile function to use a more consistent variable name statusErr for status update errors. (controllers/unleash_controller.go) [1] [2] [3] [4]

Test Suite Updates:

  • Added new test cases to ensure proper handling of deployment status and readiness checks. (controllers/unleash_controller_test.go) [1] [2]
  • Implemented the TestDeploymentIsReady function to validate the deployment readiness utility. (pkg/utils/k8s_test.go)

Utility Enhancements:

  • Added the DeploymentIsReady function to the utils package for checking deployment readiness. (pkg/utils/k8s.go)

Imports:

  • Added necessary imports for new functionalities in controllers/unleash_controller.go and pkg/utils/k8s.go. [1] [2] [3] [4]

Close #193

@Starefossen Starefossen marked this pull request as ready for review December 30, 2023 16:04
@Starefossen Starefossen requested a review from a team as a code owner December 30, 2023 16:04
Copy link
Contributor

@Reasonable-Solutions Reasonable-Solutions left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

if err != nil {
return ctrl.Result{}, err
statusErr := r.updateStatusConnectionSuccess(ctx, unleash, stats)
if statusErr != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if statusErr := .... ; statusErr != nil {...}
?
That refactor happend on line 300 so maybe it applies here to?

@Starefossen Starefossen mentioned this pull request Jul 13, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connection tests does not wait for rollout to complete
2 participants