How to reproduce it (as minimally and precisely as possible):
Install the CRD and fire the Delete event.
Anything else we need to know?:
It is possible that this code triggered the error, but it is strange that the edgex object can only be not found after remove Finalizer.
func (r *EdgeXReconciler) reconcileDelete(ctx context.Context, edgex *devicev1alpha1.EdgeX) (ctrl.Result, error) {
ud := &unitv1alpha1.YurtAppSet{}
desiredeployments := append(CoreDeployment[edgex.Spec.Version], edgex.Spec.AdditionalDeployment...)
for _, dd := range desiredeployments {
if err := r.Get(
ctx,
types.NamespacedName{Namespace: edgex.Namespace, Name: dd.Name},
ud); err != nil {
continue
}
for i, pool := range ud.Spec.Topology.Pools {
if pool.Name == edgex.Spec.PoolName {
ud.Spec.Topology.Pools[i] = ud.Spec.Topology.Pools[len(ud.Spec.Topology.Pools)-1]
ud.Spec.Topology.Pools = ud.Spec.Topology.Pools[:len(ud.Spec.Topology.Pools)-1]
}
}
if err := r.Update(ctx, ud); err != nil {
return ctrl.Result{}, err
}
}
controllerutil.RemoveFinalizer(edgex, devicev1alpha1.EdgexFinalizer)
return ctrl.Result{}, nil
}
Environment:
OpenYurt version: yurt-app-managerv0.6.0
Kubernetes version (use kubectl version): v1.23.11
What happened: When the edgex object is deleted, the reconcileDelete function displays the following error:
However, all pods can exit normally, and the functions of yurt-edgex-manager are not affected.
How to reproduce it (as minimally and precisely as possible): Install the CRD and fire the Delete event.
Anything else we need to know?: It is possible that this code triggered the error, but it is strange that the edgex object can only be not found after remove Finalizer.
Environment:
kubectl version
): v1.23.11cat /etc/os-release
): Ubuntu 20.04.4 LTSuname -a
): 5.4.0-113-genericothers
/kind bug