Skip to content

Commit

Permalink
fix: nilptr for memberjoin
Browse files Browse the repository at this point in the history
  • Loading branch information
kubeJocker committed Dec 16, 2024
1 parent 5c291a6 commit 4b5f54d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions controllers/apps/transformer_component_workload.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ func getHealthyLorryClient(pods []*corev1.Pod) (lorry.Client, error) {
}

func (r *componentWorkloadOps) annotateInstanceSetForMemberJoin() {
if r.synthesizeComp.LifecycleActions.MemberJoin == nil {
if r.synthesizeComp.LifecycleActions == nil || r.synthesizeComp.LifecycleActions.MemberJoin == nil {
return
}

Expand Down Expand Up @@ -738,13 +738,8 @@ func (r *componentWorkloadOps) checkAndDoMemberJoin() error {
return err
}

if podsToMemberjoin.Len() == 0 {
// Anno will be merged later, so it should be deleted from both protoITS and runningITS
delete(r.protoITS.Annotations, constant.MemberJoinStatusAnnotationKey)
delete(r.runningITS.Annotations, constant.MemberJoinStatusAnnotationKey)
} else {
r.protoITS.Annotations[constant.MemberJoinStatusAnnotationKey] = strings.Join(sets.List(podsToMemberjoin), ",")
}
r.protoITS.Annotations[constant.MemberJoinStatusAnnotationKey] = strings.Join(sets.List(podsToMemberjoin), ",")

return nil
}

Expand Down

0 comments on commit 4b5f54d

Please sign in to comment.