File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
operator/pkg/controller/karmada Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -176,12 +176,15 @@ func skipIfSuspended() predicate.Predicate {
176176// 1. when the karmada cr is deleted.
177177// 2. when the spec of karmada cr is updated.
178178func (ctrl * Controller ) onKarmadaUpdate (updateEvent event.UpdateEvent ) bool {
179- newObj := updateEvent .ObjectNew .(* operatorv1alpha1.Karmada )
180- oldObj := updateEvent .ObjectOld .(* operatorv1alpha1.Karmada )
179+ newObj := updateEvent .ObjectNew .(* operatorv1alpha1.Karmada ). DeepCopy ()
180+ oldObj := updateEvent .ObjectOld .(* operatorv1alpha1.Karmada ). DeepCopy ()
181181
182182 if ! newObj .DeletionTimestamp .IsZero () {
183183 return true
184184 }
185185
186+ // TODO(@zhzhuang-zju): If default values are set via an admission controller, the default() call below can be omitted.
187+ operatorscheme .Scheme .Default (newObj )
188+ operatorscheme .Scheme .Default (oldObj )
186189 return ! reflect .DeepEqual (newObj .Spec , oldObj .Spec )
187190}
You can’t perform that action at this time.
0 commit comments