Skip to content

Commit 1e2a334

Browse files
cluster: fix HPA cleanup for all cluster CRs
1 parent c988d06 commit 1e2a334

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

docs/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ aliases:
1616
* FEATURE: [vmagent](https://docs.victoriametrics.com/operator/resources/vmagent/): support `namespace` parameter in `attach_metadata` section for all scrape configurations. See [#1654](https://github.com/VictoriaMetrics/operator/issues/1654).
1717
* FEATURE: [vlagent](https://docs.victoriametrics.com/operator/resources/vlagent): support logs collection. See [#1501](https://github.com/VictoriaMetrics/operator/issues/1501).
1818

19+
* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): fixed HPA cleanup logic for all cluster resources, before it was constantly recreated. Bug introduced in [this commit](https://github.com/VictoriaMetrics/operator/commit/983d1678c37497a7d03d2f57821219fd4975deec).
20+
1921
## [v0.66.1](https://github.com/VictoriaMetrics/operator/releases/tag/v0.66.1)
2022

2123
**Release date:** 06 December 2025

internal/controller/operator/factory/vlcluster/vlcluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func deleteOrphaned(ctx context.Context, rclient client.Client, cr *vmv1.VLClust
100100
if newSelect.PodDisruptionBudget != nil {
101101
cc.KeepPDB(commonName)
102102
}
103-
if newSelect.HPA == nil {
103+
if newSelect.HPA != nil {
104104
cc.KeepHPA(commonName)
105105
}
106106
cc.KeepService(commonName)
@@ -126,7 +126,7 @@ func deleteOrphaned(ctx context.Context, rclient client.Client, cr *vmv1.VLClust
126126
if newInsert.PodDisruptionBudget != nil {
127127
cc.KeepPDB(commonName)
128128
}
129-
if newInsert.HPA == nil {
129+
if newInsert.HPA != nil {
130130
cc.KeepHPA(commonName)
131131
}
132132
cc.KeepService(commonName)

internal/controller/operator/factory/vmcluster/vmcluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ func deleteOrphaned(ctx context.Context, rclient client.Client, cr *vmv1beta1.VM
11921192
if newSelect.PodDisruptionBudget != nil {
11931193
cc.KeepPDB(commonName)
11941194
}
1195-
if newSelect.HPA == nil {
1195+
if newSelect.HPA != nil {
11961196
cc.KeepHPA(commonName)
11971197
}
11981198
cc.KeepService(commonName)
@@ -1218,7 +1218,7 @@ func deleteOrphaned(ctx context.Context, rclient client.Client, cr *vmv1beta1.VM
12181218
if newInsert.PodDisruptionBudget != nil {
12191219
cc.KeepPDB(commonName)
12201220
}
1221-
if newInsert.HPA == nil {
1221+
if newInsert.HPA != nil {
12221222
cc.KeepHPA(commonName)
12231223
}
12241224
cc.KeepService(commonName)

internal/controller/operator/factory/vtcluster/cluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func deleteOrphaned(ctx context.Context, rclient client.Client, cr *vmv1.VTClust
100100
if newSelect.PodDisruptionBudget != nil {
101101
cc.KeepPDB(commonName)
102102
}
103-
if newSelect.HPA == nil {
103+
if newSelect.HPA != nil {
104104
cc.KeepHPA(commonName)
105105
}
106106
cc.KeepService(commonName)
@@ -126,7 +126,7 @@ func deleteOrphaned(ctx context.Context, rclient client.Client, cr *vmv1.VTClust
126126
if newInsert.PodDisruptionBudget != nil {
127127
cc.KeepPDB(commonName)
128128
}
129-
if newInsert.HPA == nil {
129+
if newInsert.HPA != nil {
130130
cc.KeepHPA(commonName)
131131
}
132132
cc.KeepService(commonName)

0 commit comments

Comments
 (0)