Merge pull request #5939 from ctripcloud/work-marshaler

fix deep equal check failure in CreateOrUpdateWork(), by replace the marshaler
This commit is contained in:
karmada-bot 2025-01-15 18:18:44 +08:00 committed by GitHub
commit ce41488988
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -18,6 +18,7 @@ package ctrlutil
import (
"context"
"encoding/json"
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -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