Skip to content

change he main functions name and add more detailed comments#894

Open
LiZhenCheng9527 wants to merge 1 commit intovolcano-sh:mainfrom
LiZhenCheng9527:comments
Open

change he main functions name and add more detailed comments#894
LiZhenCheng9527 wants to merge 1 commit intovolcano-sh:mainfrom
LiZhenCheng9527:comments

Conversation

@LiZhenCheng9527
Copy link
Copy Markdown
Collaborator

What type of PR is this?
/kind enhancement

What this PR does / why we need it:

Following several revisions, the names of the main functions in the previous syncModelServing have become obsolete. Consequently, these have been updated and more detailed comments have been added.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Copilot AI review requested due to automatic review settings April 17, 2026 02:17
@volcano-sh-bot volcano-sh-bot added the kind/enhancement New feature or request label Apr 17, 2026
@volcano-sh-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from lizhencheng9527. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the ModelServingController by renaming several key synchronization methods—such as syncServingGroupReplicas, syncRoleWithinServingGroups, and manageRollingUpdate—to improve clarity and consistency. It also adds detailed documentation for these methods and introduces logic in DeleteRole to ensure roles are removed from the internal store only after their resources are fully deleted, triggering a re-reconciliation. Review feedback suggests updating an error message to align with the new method names and refining the wording of a comment regarding the role deletion process for better clarity.

Comment thread pkg/model-serving-controller/controller/model_serving_controller.go
Comment on lines +1089 to +1090
// Note: This measure is taken to prevent the Role’s resources from being deleted before the current function execution has completed,
// which would prevent them from being queued for re-coordination.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The note is confusingly worded. It seems to imply that it prevents the deletion of resources, but the logic is actually about when to remove the role from the internal store. It should clarify that the role is kept in the store with a Deleting status until its associated resources are fully removed from the cluster to prevent inconsistent state during reconciliation.

Suggested change
// Note: This measure is taken to prevent the Role’s resources from being deleted before the current function execution has completed,
// which would prevent them from being queued for re-coordination.
// Note: This measure ensures the Role remains in the store with a 'Deleting' status until its resources are fully removed from the cluster,
// preventing inconsistent state or premature re-creation during reconciliation.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the ModelServing controller’s internal function naming (to reflect “sync” semantics) and adds more detailed step-by-step comments to clarify the reconciliation flow.

Changes:

  • Renamed key reconciliation helpers (e.g., ServingGroup/Role/HeadlessService syncing) and updated call sites.
  • Added/expanded GoDoc comments describing the main reconciliation steps and rolling update behavior.
  • Added a small fast-path cleanup in DeleteRole to remove a role from the store when deletion is already complete.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
pkg/model-serving-controller/controller/model_serving_controller.go Renames internal reconciliation helpers and adds detailed GoDoc/comments; includes a DeleteRole cleanup fast-path and expanded rolling update documentation.
pkg/model-serving-controller/controller/model_serving_controller_test.go Updates tests to call the renamed controller methods.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/model-serving-controller/controller/model_serving_controller.go
Comment thread pkg/model-serving-controller/controller/model_serving_controller.go Outdated
Comment thread pkg/model-serving-controller/controller/model_serving_controller.go Outdated
Comment thread pkg/model-serving-controller/controller/model_serving_controller.go
Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement New feature or request size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants