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

feat: calculate the time we need to wait for the first applied but not ready binding to be ready. #888

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

britaniar
Copy link
Contributor

@britaniar britaniar commented Jul 18, 2024

Description of your changes

Fixes #

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Special notes for your reviewer

@britaniar britaniar force-pushed the waitTime branch 2 times, most recently from 3cb80bd to 4b8bdb0 Compare July 18, 2024 22:53
@britaniar britaniar marked this pull request as ready for review July 26, 2024 19:00
pkg/controllers/rollout/controller.go Outdated Show resolved Hide resolved
pkg/controllers/rollout/controller.go Outdated Show resolved Hide resolved
pkg/controllers/rollout/controller_test.go Outdated Show resolved Hide resolved
pkg/controllers/rollout/controller_test.go Outdated Show resolved Hide resolved
pkg/controllers/rollout/controller_test.go Outdated Show resolved Hide resolved
pkg/controllers/rollout/controller_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ryanzhang-oss ryanzhang-oss left a comment

Choose a reason for hiding this comment

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

we should piggy back the min wait time in the pickBindingsToRoll function as it goes through all bindings already

// return wait time longer if the rollout is stuck on failed apply/available bindings
allReady := true
minWaitTime := time.Duration(*crp.Spec.Strategy.RollingUpdate.UnavailablePeriodSeconds) * time.Second / 5
Copy link
Contributor

Choose a reason for hiding this comment

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

the minWaitTime should be 0 regardless of the UnavailablePeriodSeconds

// return wait time longer if the rollout is stuck on failed apply/available bindings
allReady := true
Copy link
Contributor

Choose a reason for hiding this comment

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

is this still needed?


// Process unscheduled bindings
func (r *Reconciler) processUnscheduledBinding(
crpKObj, bindingKObj klog.ObjectRef,
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought about refactoring the func but the parameters are so huge so I gave up. I guess it's still worth it.

However, we can get rid of ObjectRef.

We should also make sure what are the input vs output

Comment on lines +386 to +387
readyBindings, canBeReadyBindings, canBeUnavailableBindings *[]*fleetv1beta1.ClusterResourceBinding,
removeCandidates *[]toBeUpdatedBinding,
Copy link
Contributor

Choose a reason for hiding this comment

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

these are output. I am not sure if there is any clean way to distinguish them

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.

None yet

3 participants