Skip to content

Commit fc057c0

Browse files
committed
fix(postgres-operator): set resources on webhook-ready wait container
Address review feedback from gemini-code-assist on packages/system/postgres-operator/templates/webhook-ready-hook.yaml:115. The wait container had no resource requests or limits, so schedulers treated it as BestEffort and downstream quota enforcement had no signal. Set small requests (10m CPU, 32Mi memory) and conservative limits (100m CPU, 64Mi memory) matching the actual footprint of the kubectl polling loop. Add a matching unittest assertion so the values stay in sync if anyone touches the template. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 648ad82 commit fc057c0

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

‎packages/system/postgres-operator/templates/webhook-ready-hook.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ spec:
110110
- name: wait
111111
image: {{ $image }}
112112
imagePullPolicy: {{ if .Values.webhookReady.image.digest }}IfNotPresent{{ else }}Always{{ end }}
113+
resources:
114+
requests:
115+
cpu: 10m
116+
memory: 32Mi
117+
limits:
118+
cpu: 100m
119+
memory: 64Mi
113120
securityContext:
114121
allowPrivilegeEscalation: false
115122
readOnlyRootFilesystem: true

‎packages/system/postgres-operator/tests/webhook-ready-hook_test.yaml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,26 @@ tests:
205205
path: spec.template.spec.securityContext.seccompProfile.type
206206
value: RuntimeDefault
207207

208+
- it: wait container declares resource requests and limits for predictable scheduling
209+
template: templates/webhook-ready-hook.yaml
210+
asserts:
211+
- documentIndex: 3
212+
equal:
213+
path: spec.template.spec.containers[0].resources.requests.cpu
214+
value: 10m
215+
- documentIndex: 3
216+
equal:
217+
path: spec.template.spec.containers[0].resources.requests.memory
218+
value: 32Mi
219+
- documentIndex: 3
220+
equal:
221+
path: spec.template.spec.containers[0].resources.limits.cpu
222+
value: 100m
223+
- documentIndex: 3
224+
equal:
225+
path: spec.template.spec.containers[0].resources.limits.memory
226+
value: 64Mi
227+
208228
- it: Job container drops all capabilities and runs read-only rootfs
209229
template: templates/webhook-ready-hook.yaml
210230
asserts:

0 commit comments

Comments
 (0)