Skip to content

Commit

Permalink
fix the cache leak in yurtappoverrider controller (#1795)
Browse files Browse the repository at this point in the history
  • Loading branch information
MeenuyD authored Nov 15, 2023
1 parent 3636ec0 commit 15bd83b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ func (r *ReconcileYurtAppOverrider) Reconcile(_ context.Context, request reconci
err := r.Get(context.TODO(), request.NamespacedName, instance)
if err != nil {
if errors.IsNotFound(err) {
delete(r.CacheOverriderMap, request.Namespace+"/"+request.Name)
return reconcile.Result{}, nil
}
return reconcile.Result{}, err
Expand Down Expand Up @@ -163,9 +164,8 @@ func (r *ReconcileYurtAppOverrider) Reconcile(_ context.Context, request reconci
if reflect.DeepEqual(cacheOverrider.Entries, instance.Entries) {
return reconcile.Result{}, nil
}
} else {
r.CacheOverriderMap[instance.Namespace+"/"+instance.Name] = instance.DeepCopy()
}
r.CacheOverriderMap[instance.Namespace+"/"+instance.Name] = instance.DeepCopy()

deployments := v1.DeploymentList{}
if err := r.List(context.TODO(), &deployments); err != nil {
Expand Down

0 comments on commit 15bd83b

Please sign in to comment.