Skip to content

Commit 831a0b7

Browse files
janiszclaude
andcommitted
Fix sensor resource constraints removal to use replace instead of remove
The previous approach tried to remove the requests field, but the pod still failed with insufficient CPU even after patching. This suggests either the limits field was still present, or the remove operation didn't work as expected with the Helm-deployed sensor. New approach: - Use JSON patch "replace" operation instead of "remove" - Set entire resources field to empty object {} - This removes both limits and requests in one operation - Use kubectl rollout status to wait for deployment to complete instead of kubectl wait on pods (which fails when pods don't exist) The replace operation is more reliable than remove when the structure might vary (Helm vs direct deployment). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 82186d7 commit 831a0b7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/smoke.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ jobs:
5656

5757
- name: Remove resource constraints from Sensor
5858
run: |
59-
kubectl patch deployment sensor -n stackrox --type='json' -p='[{"op": "remove", "path": "/spec/template/spec/containers/0/resources/requests"}]'
59+
# Replace resources with empty object to remove all limits and requests
60+
kubectl patch deployment sensor -n stackrox --type='json' \
61+
-p='[{"op": "replace", "path": "/spec/template/spec/containers/0/resources", "value": {}}]'
6062
61-
- name: Wait for Sensor pods ready
62-
run: kubectl wait --for=condition=ready --timeout=300s pod -l app=sensor -n stackrox
63+
# Wait for the rollout to complete
64+
kubectl rollout status deployment/sensor -n stackrox --timeout=300s
6365
6466
- name: Extract Central password
6567
id: extract-password

0 commit comments

Comments
 (0)