fix deep equal check failure in CreateOrUpdateWork(), by replace the marshaler
Signed-off-by: zach593 <zach_li@outlook.com>
This commit is contained in:
parent
8313813f76
commit
ce1ca9912f
|
@ -18,6 +18,7 @@ package ctrlutil
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
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 {
|
if err != nil {
|
||||||
klog.Errorf("Failed to marshal workload(%s/%s), error: %v", resource.GetNamespace(), resource.GetName(), err)
|
klog.Errorf("Failed to marshal workload(%s/%s), error: %v", resource.GetNamespace(), resource.GetName(), err)
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue