Skip to content

feat: add gs-updating-containers annotation to track in-place update …#317

Open
NickPak wants to merge 1 commit intoopenkruise:masterfrom
NickPak:feat/gs-updating-containers-annotation
Open

feat: add gs-updating-containers annotation to track in-place update …#317
NickPak wants to merge 1 commit intoopenkruise:masterfrom
NickPak:feat/gs-updating-containers-annotation

Conversation

@NickPak
Copy link

@NickPak NickPak commented Feb 28, 2026

…diff (#303)

When a Pod enters the PreparingUpdate lifecycle state, automatically compute the container names whose images differ between the current Pod and the GameServerSet spec, and write them as a comma-separated list to the game.kruise.io/gs-updating-containers annotation on the Pod. During the Updating state the annotation is kept as-is so that hooks can consume it. Once the update completes (any other state), the annotation is removed via strategic-merge-patch with a null value.

  • Add GameServerUpdatingContainersKey constant
  • Extract GetDiffContainerNames utility from IsContainersPreInplaceUpdating
  • Pass GameServerSet into SyncGsToPod for image diff computation
  • Use map[string]interface{} for newAnnotations to support null (deletion)
  • Add unit tests for GetDiffContainerNames and the annotation lifecycle

…diff (openkruise#303)

When a Pod enters the PreparingUpdate lifecycle state, automatically
compute the container names whose images differ between the current Pod
and the GameServerSet spec, and write them as a comma-separated list to
the `game.kruise.io/gs-updating-containers` annotation on the Pod.
During the Updating state the annotation is kept as-is so that hooks
can consume it. Once the update completes (any other state), the
annotation is removed via strategic-merge-patch with a null value.

- Add GameServerUpdatingContainersKey constant
- Extract GetDiffContainerNames utility from IsContainersPreInplaceUpdating
- Pass GameServerSet into SyncGsToPod for image diff computation
- Use map[string]interface{} for newAnnotations to support null (deletion)
- Add unit tests for GetDiffContainerNames and the annotation lifecycle

Signed-off-by: NickPak <bc92@foxmail.com>
@kruise-bot kruise-bot requested review from FillZpp and zmberg February 28, 2026 03:07
@kruise-bot
Copy link

[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 assign zmberg for approval by writing /assign @zmberg in a comment. 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

@kruise-bot
Copy link

Welcome @NickPak! It looks like this is your first PR to openkruise/kruise-game 🎉

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

❌ Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.46%. Comparing base (03dccef) to head (7af7d86).

Files with missing lines Patch % Lines
...kg/controllers/gameserver/gameserver_controller.go 0.00% 1 Missing ⚠️
pkg/controllers/gameserver/gameserver_manager.go 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #317      +/-   ##
==========================================
+ Coverage   40.29%   40.46%   +0.17%     
==========================================
  Files         112      112              
  Lines       12518    12532      +14     
==========================================
+ Hits         5044     5071      +27     
+ Misses       7067     7051      -16     
- Partials      407      410       +3     
Flag Coverage Δ
unittests 40.46% <90.47%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants