Skip to content

原地更新时,能否在PreparingUpdate阶段告知即将更新的容器有哪些? #303

@NickPak

Description

@NickPak

问题背景:
目前在 Kruise InPlace Update 的 PreparingUpdate Hook 中,如果想知道本次更新会改哪些 containers,需要在 Hook 里自行对比 Pod 当前 containerStatuses 和 GameServerSet 模板中的 containers,重复实现 diff 逻辑。

现状:
项目中已有:

  • util.IsContainersPreInplaceUpdating(pod, gss, containerNames),内部已经计算出 diff 容器名;
  • GameServer 控制器在 SyncPodToGs 中同步 GameServer.Status,掌握 pod + gss;

建议:

  • 在 GameServerStatus 中增加 nextUpdateContainers []string 字段,或
  • 在 Pod / GameServer 上增加 game.kruise.io/next-update-containers annotation;
  • 并在 GameServerManager.SyncPodToGs 或 GameServerReconciler.Reconcile 中,当 Pod 处于 LifecycleStatePreparingUpdate 时,将 diff 容器名写入该字段/annotation,避免每个 Hook 自己做 diff。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions