Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xuriwuyun committed Jan 23, 2025
1 parent 7eec25c commit 09f134e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/controller/instanceset/pod_role_event_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ func updatePodRoleLabel(cli client.Client, reqCtx intctrlutil.RequestCtx,
role, ok := roleMap[roleName]
switch ok {
case true:
pod.Labels[RoleLabelKey] = role.Name
newPod.Labels[RoleLabelKey] = role.Name
case false:
delete(pod.Labels, RoleLabelKey)
delete(newPod.Labels, RoleLabelKey)
}

if pod.Annotations == nil {
pod.Annotations = map[string]string{}
if newPod.Annotations == nil {
newPod.Annotations = map[string]string{}
}
newPod.Annotations[constant.LastRoleSnapshotVersionAnnotationKey] = version
return cli.Update(ctx, newPod, inDataContext())
Expand Down

0 comments on commit 09f134e

Please sign in to comment.