Merge pull request #2081 from hanweisen/fixbug

avoid required label override by overridepolicy
This commit is contained in:
karmada-bot 2022-07-02 18:05:31 +08:00 committed by GitHub
commit 753d3df43e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -93,8 +93,6 @@ func ensureWork(
return err
}
workLabel := mergeLabel(clonedWorkload, workNamespace, binding, scope)
if hasScheduledReplica {
if resourceInterpreter.HookEnabled(clonedWorkload.GroupVersionKind(), configv1alpha1.InterpreterOperationReviseReplica) {
clonedWorkload, err = resourceInterpreter.ReviseReplica(clonedWorkload, desireReplicaInfos[targetCluster.Name])
@ -124,6 +122,7 @@ func ensureWork(
klog.Errorf("Failed to apply overrides for %s/%s/%s, err is: %v", clonedWorkload.GetKind(), clonedWorkload.GetNamespace(), clonedWorkload.GetName(), err)
return err
}
workLabel := mergeLabel(clonedWorkload, workNamespace, binding, scope)
annotations := mergeAnnotations(clonedWorkload, binding, scope)
annotations, err = recordAppliedOverrides(cops, ops, annotations)