From 48432d1869a49342f1ae8a704a4b149a0721cd93 Mon Sep 17 00:00:00 2001 From: Guilherme Moreira Rodrigues Date: Wed, 29 Jul 2026 15:56:32 -0300 Subject: [PATCH] fix(plugin-br-pix-direct-jd): guard replicas when autoscaling enabled The plugin-br-pix-direct-jd Deployment template(s) (pix, qr-code) 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..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 --- .../templates/plugin-br-pix-direct-jd-qr-code/deployment.yaml | 2 ++ .../templates/plugin-br-pix-direct-jd/deployment.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/charts/plugin-br-pix-direct-jd/templates/plugin-br-pix-direct-jd-qr-code/deployment.yaml b/charts/plugin-br-pix-direct-jd/templates/plugin-br-pix-direct-jd-qr-code/deployment.yaml index db5ae3b22..93297a71b 100644 --- a/charts/plugin-br-pix-direct-jd/templates/plugin-br-pix-direct-jd-qr-code/deployment.yaml +++ b/charts/plugin-br-pix-direct-jd/templates/plugin-br-pix-direct-jd-qr-code/deployment.yaml @@ -7,7 +7,9 @@ metadata: spec: strategy: {{- toYaml .Values.qrcode.deploymentStrategy | nindent 4 }} + {{- if not .Values.qrcode.autoscaling.enabled }} replicas: {{ .Values.qrcode.replicaCount }} + {{- end }} selector: matchLabels: {{- include "plugin-br-pix-direct-jd-qr-code.selectorLabels" (dict "context" . "name" .Values.qrcode.name) | nindent 6 }} diff --git a/charts/plugin-br-pix-direct-jd/templates/plugin-br-pix-direct-jd/deployment.yaml b/charts/plugin-br-pix-direct-jd/templates/plugin-br-pix-direct-jd/deployment.yaml index 69fb621f7..31e6abb5f 100644 --- a/charts/plugin-br-pix-direct-jd/templates/plugin-br-pix-direct-jd/deployment.yaml +++ b/charts/plugin-br-pix-direct-jd/templates/plugin-br-pix-direct-jd/deployment.yaml @@ -8,7 +8,9 @@ spec: revisionHistoryLimit: {{ .Values.pix.revisionHistoryLimit | default 10 }} strategy: {{- toYaml .Values.pix.deploymentStrategy | nindent 4 }} + {{- if not .Values.pix.autoscaling.enabled }} replicas: {{ .Values.pix.replicaCount }} + {{- end }} selector: matchLabels: {{- include "plugin-br-pix-direct-jd.selectorLabels" (dict "context" . "name" .Values.pix.name) | nindent 6 }}