From d3a0fa86458246dd935349bfe5249c775730fec7 Mon Sep 17 00:00:00 2001 From: Nikolay Date: Thu, 18 Jul 2024 04:11:43 +0200 Subject: [PATCH] internal/finalize: fixes typo at PDB delete function (#1039) Previously name and namespace args were misplaced at removeFinalize function call. It prevented from proper object deletion. And caused various errors during objects deletion. https://github.com/VictoriaMetrics/operator/issues/1036 Signed-off-by: f41gh7 --- docs/CHANGELOG.md | 3 ++- internal/controller/operator/factory/finalize/common.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index c4dd5dd3..a184979a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -13,6 +13,8 @@ aliases: --- # CHANGELOG +- [operator](./README.md): properly release `PodDisruptionBudget` object finalizer. Previously it could be kept due to typo. See this [issue](https://github.com/VictoriaMetrics/operator/issues/1036) for details. + ## [v0.46.4](https://github.com/VictoriaMetrics/operator/releases/tag/v0.46.4) - 9 Jul 2024 ### Breaking changes @@ -1769,4 +1771,3 @@ it contains basic api objects support: [v0.0.6]: https://github.com/VictoriaMetrics/operator/compare/v0.0.2...v0.0.6 [v0.0.2]: https://github.com/VictoriaMetrics/operator/compare/v0.0.1...v0.0.2 [v0.0.1]: https://github.com/VictoriaMetrics/operator/tree/v0.0.1 - diff --git a/internal/controller/operator/factory/finalize/common.go b/internal/controller/operator/factory/finalize/common.go index d29d8033..3b38a843 100644 --- a/internal/controller/operator/factory/finalize/common.go +++ b/internal/controller/operator/factory/finalize/common.go @@ -98,7 +98,7 @@ func finalizePBD(ctx context.Context, rclient client.Client, crd crdObject) erro return removeFinalizeObjByName(ctx, rclient, &policyv1.PodDisruptionBudget{}, crd.PrefixedName(), crd.GetNSName()) } -func finalizePBDWithName(ctx context.Context, rclient client.Client, ns, name string) error { +func finalizePBDWithName(ctx context.Context, rclient client.Client, name, ns string) error { return removeFinalizeObjByName(ctx, rclient, &policyv1.PodDisruptionBudget{}, name, ns) }