Checklist
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
Checklist
Describe the bug
Status part of a rbg may be used by other controllers. However, the
ObservedGenerationwas droped when setting conditions and statsusrbg/internal/controller/workloads/rolebasedgroup_controller.go
Line 658 in 415f586
rbg/internal/controller/workloads/pod_controller.go
Lines 163 to 173 in 415f586
Reproduction
create a RBG
sample
and status
Which does not contain
ObservedGenerationEnvironment
latest main