Skip to content

[Bug] observed generation not allied in status #196

@JasonHe-WQ

Description

@JasonHe-WQ

Checklist

  • 1. I have searched related issues but cannot get the expected help.
  • 2. The bug has not been fixed in the latest version.
  • 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback.
  • 4. If the issue you raised is not a bug but a question, please raise a discussion at https://github.com/sgl-project/sglang/discussions/new/choose Otherwise, it will be closed.
  • 5. Please use English, otherwise it will be closed.

Describe the bug

Status part of a rbg may be used by other controllers. However, the ObservedGeneration was droped when setting conditions and statsus

setCondition(rbg, readyCondition)

func ToRBGApplyConfigurationForStatus(rbg *workloadsv1alpha2.RoleBasedGroup) *applyconfiguration.RoleBasedGroupApplyConfiguration {
if rbg == nil {
return nil
}
gkv := utils.GetRbgGVK()
rbgApplyConfig := applyconfiguration.RoleBasedGroup(rbg.Name, rbg.Namespace).
WithKind(gkv.Kind).
WithAPIVersion(gkv.GroupVersion().String()).
WithStatus(applyconfiguration.RoleBasedGroupStatus().WithRoleStatuses(ToRoleStatusApplyConfiguration(rbg.Status.RoleStatuses)...).WithConditions(ToConditionApplyConfigurations(rbg.Status.Conditions)...))
return rbgApplyConfig
}

Reproduction

create a RBG

sample

apiVersion: workloads.x-k8s.io/v1alpha2
kind: RoleBasedGroup
metadata:
  name: epd-test
  namespace: rbg-test
spec:
  roles:
    - name: router
      replicas: 2
      rolloutStrategy:
        type: RollingUpdate
        rollingUpdate:
          type: InPlaceIfPossible
      restartPolicy: RecreateRoleInstanceOnPodRestart
      leaderWorkerPattern:
        size: 2
        template:
          spec:
            containers:
              - name: main
                image: ubuntu:20.04
                command: ["sleep"]
                args: ["infinity"]

    - name: encoder
      replicas: 1
      rolloutStrategy:
        type: RollingUpdate
        rollingUpdate:
          type: InPlaceIfPossible
      restartPolicy: RecreateRoleInstanceOnPodRestart
      leaderWorkerPattern:
        size: 1
        template:
          spec:
            containers:
              - name: main
                image: ubuntu:20.04
                command: ["sleep"]
                args: ["infinity"]
                env:
                  - name: POD_IP
                    valueFrom:
                      fieldRef:
                        fieldPath: status.podIP

    - name: prefill
      replicas: 3
      rolloutStrategy:
        type: RollingUpdate
        rollingUpdate:
          type: InPlaceIfPossible
      restartPolicy: RecreateRoleInstanceOnPodRestart
      leaderWorkerPattern:
        size: 4
        template:
          spec:
            hostNetwork: false
            containers:
              - name: main
                image: ubuntu:20.04
                command: ["sleep"]
                args: ["infinity"]
                env:
                  - name: POD_IP
                    valueFrom:
                      fieldRef:
                        fieldPath: status.podIP

    - name: decode
      replicas: 1
      rolloutStrategy:
        type: RollingUpdate
        rollingUpdate:
          type: InPlaceIfPossible
      restartPolicy: RecreateRoleInstanceOnPodRestart
      leaderWorkerPattern:
        size: 1
        template:
          spec:
            hostNetwork: false
            containers:
              - name: main
                image: ubuntu:20.04
                command: ["sleep"]
                args: ["infinity"]

and status

  status:
    conditions:
    - lastTransitionTime: "2026-03-13T09:09:24Z"
      message: All roles are ready
      reason: AllRolesReady
      status: "True"
      type: Ready
    roleStatuses:
    - name: router
      readyReplicas: 2
      replicas: 2
      updatedReplicas: 2
    - name: encoder
      readyReplicas: 1
      replicas: 1
      updatedReplicas: 1
    - name: prefill
      readyReplicas: 3
      replicas: 3
      updatedReplicas: 3
    - name: decode
      readyReplicas: 1
      replicas: 1
      updatedReplicas: 1
kind: List
metadata:
  resourceVersion: ""

Which does not contain ObservedGeneration

Environment

latest main

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