Skip to content

Commit

Permalink
Merge pull request #3698 from yike21/automated-cherry-pick-of-#3683-u…
Browse files Browse the repository at this point in the history
…pstream-release-1.6

Automated cherry pick of #3683: fix aggregateCronJobStatus panic
  • Loading branch information
karmada-bot committed Jun 26, 2023
2 parents 8b54449 + 21ac25a commit 8dab666
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/resourceinterpreter/default/native/aggregatestatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ func aggregateCronJobStatus(object *unstructured.Unstructured, aggregatedStatusI
if err = json.Unmarshal(item.Status.Raw, temp); err != nil {
return nil, err
}
klog.V(3).Infof("Grab cronJob(%s/%s) status from cluster(%s), active: %+v, lastScheduleTime: %s, lastSuccessfulTime: %s",
cronjob.Namespace, cronjob.Name, item.ClusterName, temp.Active, temp.LastScheduleTime.String(), temp.LastSuccessfulTime.String())
klog.V(3).Infof("Grab cronJob(%s/%s) status from cluster(%s), active: %+v, lastScheduleTime: %+v, lastSuccessfulTime: %+v",
cronjob.Namespace, cronjob.Name, item.ClusterName, temp.Active, temp.LastScheduleTime, temp.LastSuccessfulTime)
newStatus.Active = append(newStatus.Active, temp.Active...)
if newStatus.LastScheduleTime == nil {
newStatus.LastScheduleTime = temp.LastScheduleTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ func Test_aggregateCronJobStatus(t *testing.T) {
},
},
"lastScheduleTime": "2023-02-08T07:16:00Z",
"lastSuccessfulTime": "2023-02-08T07:15:00Z",
"lastSuccessfulTime": nil,
})
cronjobStatusRaw2, _ := helper.BuildStatusRawExtension(map[string]interface{}{
"active": []corev1.ObjectReference{
Expand Down

0 comments on commit 8dab666

Please sign in to comment.