Skip to content

Commit 0d67175

Browse files
authored
Merge pull request #3723 from jwcesign/automated-cherry-pick-of-#3709-upstream-release-1.5
Automated cherry pick of #3709: fix the Applied of ResourceBinding is always true
2 parents db8c930 + 89f59d1 commit 0d67175

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/util/objectwatcher/objectwatcher.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ func (o *objectWatcherImpl) retainClusterFields(desired, observed *unstructured.
126126
func (o *objectWatcherImpl) Update(clusterName string, desireObj, clusterObj *unstructured.Unstructured) error {
127127
updateAllowed := o.allowUpdate(clusterName, desireObj, clusterObj)
128128
if !updateAllowed {
129-
return nil
129+
// The existing resource is not managed by Karmada, and no conflict resolution found, avoid updating the existing resource by default.
130+
return fmt.Errorf("resource(kind=%s, %s/%s) already exist in cluster %v and the %s strategy value is empty, karmada will not manage this resource",
131+
desireObj.GetKind(), desireObj.GetNamespace(), desireObj.GetName(), clusterName, workv1alpha2.ResourceConflictResolutionAnnotation,
132+
)
130133
}
131134

132135
dynamicClusterClient, err := o.ClusterClientSetFunc(clusterName, o.KubeClientSet)

0 commit comments

Comments
 (0)