avoid required label override by overridepolicy

Signed-off-by: hanweisen <hanweisen_yewu@cmss.chinamobile.com>
This commit is contained in:
hanweisen 2022-06-29 00:24:42 +08:00
parent 4a243f447a
commit 7219bf6655
1 changed files with 1 additions and 2 deletions

View File

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