diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index da969b50d..66d7e1477 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -22,6 +22,7 @@ aliases: * BUGFIX: [vmalertmanager](https://docs.victoriametrics.com/operator/resources/vmalertmanager/): fixed ignored alertmanager template if it has no discovered VMAlertmanagerconfig CRs or tracing config defined. See [#2121](https://github.com/VictoriaMetrics/operator/issues/2121). * BUGFIX: [VMCluster](https://docs.victoriametrics.com/operator/resources/vmcluster/), [VTCluster](https://docs.victoriametrics.com/operator/resources/vtcluster/) and [VLCluster](https://docs.victoriametrics.com/operator/resources/vlcluster/): fixed infinite non-default additional service recreation, when requestsLoadBalancer.enabled: true * BUGFIX: [vmauth](https://docs.victoriametrics.com/operator/resources/vmauth/): fixed case, when target_path_suffix can be appended multiple times. +* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): retry reconcile errors, that may lead to expanding state, before resource could hang in expanding state. ## [v0.69.0](https://github.com/VictoriaMetrics/operator/releases/tag/v0.69.0) **Release date:** 22 April 2026 diff --git a/internal/controller/operator/controllers.go b/internal/controller/operator/controllers.go index 5b1871bc8..14afc7933 100644 --- a/internal/controller/operator/controllers.go +++ b/internal/controller/operator/controllers.go @@ -345,8 +345,8 @@ func reconcileAndTrackStatus[T client.Object, ST reconcile.StatusWithMetadata[ST resultStatus = vmv1beta1.UpdateStatusExpanding } else { resultStatus = vmv1beta1.UpdateStatusFailed - resultErr = err } + resultErr = err return } if specChanged { diff --git a/internal/controller/operator/reconcile_and_track_status_test.go b/internal/controller/operator/reconcile_and_track_status_test.go index e300fc0ec..7d02dbade 100644 --- a/internal/controller/operator/reconcile_and_track_status_test.go +++ b/internal/controller/operator/reconcile_and_track_status_test.go @@ -74,7 +74,7 @@ func TestReconcileAndTrackStatus(t *testing.T) { wantStatus: vmv1beta1.UpdateStatusOperational, }) - // retryable conflict error, operational → expanding + // retryable conflict error, operational → expanding, error propagated for requeue opSpec := vmv1beta1.VMAlertSpec{SelectAllByDefault: true} f(opts{ object: &vmv1beta1.VMAlert{ @@ -89,9 +89,10 @@ func TestReconcileAndTrackStatus(t *testing.T) { return ctrl.Result{}, k8serrors.NewConflict(schema.GroupResource{Group: "apps", Resource: "deployments"}, "test", fmt.Errorf("conflict")) }, wantStatus: vmv1beta1.UpdateStatusExpanding, + wantErr: true, }) - // retryable wait interrupted, operational → expanding + // retryable wait interrupted, operational → expanding, error propagated for requeue f(opts{ object: &vmv1beta1.VMAlert{ ObjectMeta: metav1.ObjectMeta{Name: "test-vmalert", Namespace: "default"}, @@ -105,6 +106,7 @@ func TestReconcileAndTrackStatus(t *testing.T) { return ctrl.Result{}, wait.ErrorInterrupted(fmt.Errorf("timeout")) }, wantStatus: vmv1beta1.UpdateStatusExpanding, + wantErr: true, }) // operational → expanding → operational @@ -237,7 +239,7 @@ func TestVMClusterRemainsExpandingDuringPVCResize(t *testing.T) { _, err := reconcileAndTrackStatus(context.Background(), fclient, cluster, func() (ctrl.Result, error) { return ctrl.Result{}, wait.ErrorInterrupted(fmt.Errorf("pvc resize still in progress")) }) - assert.NoError(t, err) + assert.Error(t, err) got := &vmv1beta1.VMCluster{} assert.NoError(t, fclient.Get(context.Background(), types.NamespacedName{Name: "test-vmcluster", Namespace: "default"}, got))