Skip to content

Commit

Permalink
controllers/vmalertmanagerconfig: adds missing err handle callback (#984
Browse files Browse the repository at this point in the history
)

Fixes missing callback after bc09a9b

Signed-off-by: f41gh7 <[email protected]>
  • Loading branch information
f41gh7 authored Jun 21, 2024
1 parent 09de682 commit 5cef723
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions controllers/vmalertmanagerconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ func (r *VMAlertmanagerConfigReconciler) Scheme() *runtime.Scheme {
// Reconcile implements interface
// +kubebuilder:rbac:groups=operator.victoriametrics.com,resources=vmalertmanagerconfigs,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=operator.victoriametrics.com,resources=vmalertmanagerconfigs/status,verbs=get;update;patch
func (r *VMAlertmanagerConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, err error) {
func (r *VMAlertmanagerConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, resultErr error) {
l := r.Log.WithValues("vmalertmanagerconfig", req.NamespacedName, "name", req.Name)
defer func() {
result, resultErr = handleReconcileErr(ctx, r.Client, nil, result, resultErr)
}()

var instance victoriametricsv1beta1.VMAlertmanagerConfig
if err := r.Client.Get(ctx, req.NamespacedName, &instance); err != nil {

if err := r.Get(ctx, req.NamespacedName, &instance); err != nil {
return result, &getError{err, "vmalertmanagerconfig", req}
}

Expand Down
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ aliases:

- [operator](#./README.md): fix VM CRs' `xxNamespaceSelector` and `xxSelector` options, previously they are inverted. See this [issue](https://github.com/VictoriaMetrics/operator/issues/980) for details.

- [vmalertmanagerconfig](./api.md#vmalertmanagerconfig): adds missing `handleReconcileErr` callback to the reconcile loop. It must properly handle errors and deregister objects.

<a name="v0.45.0"></a>

## [v0.45.0](https://github.com/VictoriaMetrics/operator/releases/tag/v0.45.0) - 10 Jun 2024
Expand Down

0 comments on commit 5cef723

Please sign in to comment.