diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4874119ee..f8bb6b159 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -43,7 +43,6 @@ aliases: * BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): previously, recreating a resource after deletion could hang and block updates; now resource recreation completes normally. See [#1707](https://github.com/VictoriaMetrics/operator/issues/1707). * BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): use global image registry unless image.repository is defined. See [#1813](https://github.com/VictoriaMetrics/operator/issues/1813). * BUGFIX: [vmalertmanagerconfig](https://docs.victoriametrics.com/operator/resources/vmalertmanagerconfig/): previously spec.route and spec.receivers were required; now both parameters are optional to align with prometheus operator. VMAlertmanager now can be used to set just the global inhibition rules. See [#1800](https://github.com/VictoriaMetrics/operator/issues/1800). -* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): use global image registry unless image.repository is defined. See [#1813](https://github.com/VictoriaMetrics/operator/issues/1813). ## [v0.67.0](https://github.com/VictoriaMetrics/operator/releases/tag/v0.67.0) **Release date:** 23 January 2026 diff --git a/internal/controller/operator/factory/reconcile/statefulset.go b/internal/controller/operator/factory/reconcile/statefulset.go index be85a02a2..ddbef4b32 100644 --- a/internal/controller/operator/factory/reconcile/statefulset.go +++ b/internal/controller/operator/factory/reconcile/statefulset.go @@ -341,9 +341,8 @@ func PodIsReady(pod *corev1.Pod, minReadySeconds int32) bool { } func waitForPodReady(ctx context.Context, rclient client.Client, nsn types.NamespacedName, desiredRevision string, minReadySeconds int32) error { - var pod *corev1.Pod + var pod corev1.Pod if err := wait.PollUntilContextTimeout(ctx, podWaitReadyIntervalCheck, podWaitReadyTimeout, true, func(_ context.Context) (done bool, err error) { - var pod corev1.Pod err = rclient.Get(ctx, nsn, &pod) if err != nil { return false, fmt.Errorf("cannot get pod: %q: %w", nsn, err) @@ -358,10 +357,10 @@ func waitForPodReady(ctx context.Context, rclient client.Client, nsn types.Names } return PodIsReady(&pod, minReadySeconds), nil }); err != nil { - if pod == nil { + if len(pod.Name) == 0 { return err } - return podStatusesToError(err, pod) + return podStatusesToError(err, &pod) } return nil } @@ -442,7 +441,7 @@ func sortStsPodsByID(src []corev1.Pod) error { return firstParseError } -func isSTSPod(pod *corev1.Pod) bool { +func isOwnedBySTS(pod *corev1.Pod) bool { for _, ref := range pod.OwnerReferences { if ref.Kind == "StatefulSet" { return true @@ -457,7 +456,7 @@ func filterSTSPods(pods []corev1.Pod, revision string, minReadySeconds int32, re // pod could be owned by Deployment due to Deployment -> StatefulSet transition isSameRevision := pod.Labels[podRevisionLabel] == revision switch { - case !isSTSPod(&pod): + case !isOwnedBySTS(&pod): case !pod.DeletionTimestamp.IsZero() || recreate: podsForUpdate = append(podsForUpdate, pod) case PodIsReady(&pod, minReadySeconds) && isSameRevision: