Skip to content

Commit

Permalink
Use common.Reconciled and RequeueWithError
Browse files Browse the repository at this point in the history
  • Loading branch information
bmangoen committed Sep 25, 2023
1 parent 2bb972c commit 821005a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Binary file added bin/controller-gen
Binary file not shown.
Binary file added bin/kustomize
Binary file not shown.
Binary file added bin/operator-sdk
Binary file not shown.
12 changes: 6 additions & 6 deletions pkg/controller/servicemesh/memberroll/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,17 @@ func (r *MemberRollReconciler) Reconcile(request reconcile.Request) (reconcile.R
if err != nil {
if errors.IsNotFound(err) {
// Request controlPlane object not found, could have been deleted after reconcile request.
return reconcile.Result{}, nil
return common.Reconciled()
}
// Error reading the controlPlane object
return reconcile.Result{}, err
return common.RequeueWithError(err)
}
if controlPlane != nil {
meshNamespace := controlPlane.GetNamespace()
meshVersion := controlPlane.Spec.Version
meshMode, err := getMeshMode(controlPlane)
if err != nil {
return reconcile.Result{}, err
return common.RequeueWithError(err)
}
internalmetrics.DeleteMeshMembersWithLabelsValues(meshNamespace, meshVersion, meshMode)
}
Expand Down Expand Up @@ -475,16 +475,16 @@ func (r *MemberRollReconciler) reconcileObject(ctx context.Context, roll *maistr
meshVersion := mesh.Spec.Version
meshMode, err := getMeshMode(mesh)
if err != nil {
return reconcile.Result{}, err
return common.RequeueWithError(err)
}
// Control plane mode would not be well set yet
if meshMode == "" {
return reconcile.Result{}, nil
return common.Reconciled()
}
internalmetrics.GetMeshMembers(meshNamespace, meshVersion, meshMode).
Set(float64(len(roll.Status.ConfiguredMembers)))
}
return reconcile.Result{}, nil
return common.Reconciled()
}

func getExcludedNamespaces() []string {
Expand Down

0 comments on commit 821005a

Please sign in to comment.