-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(v2beta1): fix error for when delete pods, emqx still ready
- Loading branch information
Showing
3 changed files
with
53 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,7 +87,7 @@ func NewEMQXReconciler(mgr manager.Manager) *EMQXReconciler { | |
// For more details, check Reconcile and its Result here: | ||
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/reconcile | ||
func (r *EMQXReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { | ||
_ = log.FromContext(ctx) | ||
logger := log.FromContext(ctx) | ||
|
||
instance := &appsv2beta1.EMQX{} | ||
if err := r.Client.Get(ctx, req.NamespacedName, instance); err != nil { | ||
|
@@ -117,15 +117,16 @@ func (r *EMQXReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl. | |
&syncConfig{r}, | ||
&addSvc{r}, | ||
&updatePodConditions{r}, | ||
&syncPods{r}, | ||
&updateStatus{r}, | ||
&syncPods{r}, | ||
} { | ||
subResult := subReconciler.reconcile(ctx, instance, requester) | ||
if !subResult.result.IsZero() { | ||
return subResult.result, nil | ||
} | ||
if subResult.err != nil { | ||
if innerErr.IsCommonError(subResult.err) { | ||
logger.V(1).Info("requeue reconcile", "reconciler", subReconciler, "reason", subResult.err) | ||
return ctrl.Result{RequeueAfter: time.Second}, nil | ||
} | ||
r.EventRecorder.Event(instance, corev1.EventTypeWarning, "ReconcilerFailed", emperror.Cause(subResult.err).Error()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters