-
Notifications
You must be signed in to change notification settings - Fork 453
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
[RayService] Add a safeguard to prevent overriding the pending cluster during a upgrade #2887
[RayService] Add a safeguard to prevent overriding the pending cluster during a upgrade #2887
Conversation
3fcc4a7
to
9ca4b4a
Compare
@@ -243,6 +243,7 @@ func (r *RayServiceReconciler) calculateStatus(ctx context.Context, rayServiceIn | |||
rayServiceInstance.Status.ActiveServiceStatus.Applications = activeClusterServeApplications | |||
rayServiceInstance.Status.PendingServiceStatus.Applications = pendingClusterServeApplications | |||
|
|||
var servingClusterName string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use a boolean to indicate whether the services point to the pending cluster instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, but I think using a Boolean feels like leaving the actual check outside of the shouldXXX function.
8e02563
to
2311404
Compare
assert.True(t, shouldPrepareNewCluster) | ||
} | ||
|
||
func TestShouldPrepareNewCluster_RecreatePendingCluster(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two tests look pretty similar how about merging it into one test with t.Run(...)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -243,6 +243,7 @@ func (r *RayServiceReconciler) calculateStatus(ctx context.Context, rayServiceIn | |||
rayServiceInstance.Status.ActiveServiceStatus.Applications = activeClusterServeApplications | |||
rayServiceInstance.Status.PendingServiceStatus.Applications = pendingClusterServeApplications | |||
|
|||
var isPendingClusterServing bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explicitly initialing it to false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
5e23364
to
5b226cb
Compare
…r during a upgrade Signed-off-by: Rueian <[email protected]>
5b226cb
to
1981f08
Compare
Why are these changes needed?
Fixes #2877.
Currently, a pending cluster will only be overridden if it is unhealthy, which is safe, but this behavior implicitly relies on the current implementation. This PR introduces an explicit check to prevent the overriding of a pending cluster that is actively serving.
Related issue number
Checks