Skip to content

Commit

Permalink
Merge pull request #5939 from ctripcloud/work-marshaler
Browse files Browse the repository at this point in the history
fix deep equal check failure in CreateOrUpdateWork(), by replace the marshaler
  • Loading branch information
karmada-bot authored Jan 15, 2025
2 parents 9641207 + ce1ca99 commit ce41488
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controllers/ctrlutil/work.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package ctrlutil

import (
"context"
"encoding/json"
"fmt"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -48,7 +49,7 @@ func CreateOrUpdateWork(ctx context.Context, client client.Client, workMeta meta
}
}

workloadJSON, err := resource.MarshalJSON()
workloadJSON, err := json.Marshal(resource)
if err != nil {
klog.Errorf("Failed to marshal workload(%s/%s), error: %v", resource.GetNamespace(), resource.GetName(), err)
return err
Expand Down

0 comments on commit ce41488

Please sign in to comment.