Skip to content

fix(plugin-fees): guard replicas when autoscaling enabled - #1764

Open
guimoreirar wants to merge 1 commit into
mainfrom
fix/plugin-fees-replicas-hpa-ssa
Open

fix(plugin-fees): guard replicas when autoscaling enabled#1764
guimoreirar wants to merge 1 commit into
mainfrom
fix/plugin-fees-replicas-hpa-ssa

Conversation

@guimoreirar

Copy link
Copy Markdown
Member

Midaz Pull Request Checklist

Pull Request Type

  • Plugin Fees

Summary

Fixes a Server-Side Apply field-ownership conflict on .spec.replicas — the same class of bug as #1760 (plugin-br-pix-indirect-btg), found by a repo-wide sweep.

The plugin-fees Deployment template(s) (fees) rendered spec.replicas unconditionally, even with autoscaling.enabled: true. When the chart's HPA is active, kube-controller-manager owns .spec.replicas via the scale subresource, so under SSA (Rancher/Fleet, ArgoCD) Helm and the HPA contend for the field:

conflict with "kube-controller-manager" with subresource "scale" using apps/v1: .spec.replicas

Fix

Wrap replicas in {{- if not .Values.<component>.autoscaling.enabled }} so it is omitted whenever that component's HPA owns it. Standard HPA-chart practice (Bitnami, kube-prometheus-stack).

Testing

  • helm template verified: autoscaling.enabled=truespec.replicas absent; false → declared replicaCount.

Checklist

  • I have tested these changes locally.
  • This PR modifies only one chart.
  • I did not hand-edit Chart.yaml version, CHANGELOG.md, or the README version matrix (CI owns these; fix → patch bump).

Additional Notes

Part of a coordinated sweep of the HPA/SSA replicas bug across charts. lerian-common _deployment.tpl does not emit replicas, so lib-based charts are unaffected.

The plugin-fees Deployment template(s) (fees) rendered spec.replicas
unconditionally even with autoscaling.enabled=true. With an HPA active,
kube-controller-manager owns .spec.replicas via the scale subresource, so
Server-Side Apply (Rancher/Fleet, ArgoCD) rejects helm upgrade with a
field-ownership conflict on .spec.replicas.

Wrap replicas in {{- if not .Values.<component>.autoscaling.enabled }} so the
field is omitted when the HPA owns it. Same class of fix as plugin-br-pix-indirect-btg.

X-Lerian-Ref: 0x1
@guimoreirar
guimoreirar requested a review from a team as a code owner July 29, 2026 18:56
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f2969d2e-6fa6-4b72-97c9-017850f3b218

📥 Commits

Reviewing files that changed from the base of the PR and between 1d7853b and 2643d98.

📒 Files selected for processing (1)
  • charts/plugin-fees/templates/fees/deployment.yaml

📝 Walkthrough

Walkthrough

The fees Deployment template now conditionally renders spec.replicas, omitting the field when fees autoscaling is enabled.

Changes

Fees Deployment scaling

Layer / File(s) Summary
Conditional replicas field
charts/plugin-fees/templates/fees/deployment.yaml
The replicas field now renders fees.replicaCount only when fees.autoscaling.enabled is false.

Possibly related PRs

  • LerianStudio/helm#1760: Updates related Helm Deployment templates to conditionally render replicas when autoscaling is disabled.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/plugin-fees-replicas-hpa-ssa

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant