Add grace period support to pod deletion action#2125
Conversation
The parameter defaults to None, preserving the existing behavior (pod's default grace period) for backward compatibility. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GT8gcjrboPS1NkX52BBeLD
|
✅ Docker image ready for
Use this tag to pull the image for testing. 📋 Copy commandsgcloud auth configure-docker us-central1-docker.pkg.dev
docker pull us-central1-docker.pkg.dev/robusta-development/temporary-builds/robusta-runner:9fac765
docker tag us-central1-docker.pkg.dev/robusta-development/temporary-builds/robusta-runner:9fac765 me-west1-docker.pkg.dev/robusta-development/development/robusta-runner-dev:9fac765
docker push me-west1-docker.pkg.dev/robusta-development/development/robusta-runner-dev:9fac765Patch Helm values in one line: helm upgrade --install robusta robusta/robusta \
--reuse-values \
--set runner.image=me-west1-docker.pkg.dev/robusta-development/development/robusta-runner-dev:9fac765 |
WalkthroughThe delete-alert-pod action adds an optional ChangesPod deletion grace period
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
playbooks/robusta_playbooks/pod_actions.py (1)
67-67: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd regression tests for
DeleteAlertPodParams.grace_period_seconds. CoverNone,0, and a positive custom value, and assertpod.deletereceives the matchinggrace_period_secondskeyword argument.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@playbooks/robusta_playbooks/pod_actions.py` at line 67, Add regression tests for DeleteAlertPodParams.grace_period_seconds covering None, 0, and a positive custom value. Exercise the pod deletion flow and assert pod.delete is called with the corresponding grace_period_seconds keyword argument in each case.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@playbooks/robusta_playbooks/pod_actions.py`:
- Line 67: Add regression tests for DeleteAlertPodParams.grace_period_seconds
covering None, 0, and a positive custom value. Exercise the pod deletion flow
and assert pod.delete is called with the corresponding grace_period_seconds
keyword argument in each case.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0ec30136-be67-4c01-a4ad-0b9f6fd53a47
📒 Files selected for processing (1)
playbooks/robusta_playbooks/pod_actions.py
Summary
Added support for configurable grace period when deleting pods in the
delete_alert_podaction, allowing users to specify how long Kubernetes should wait before forcefully terminating a pod.Changes
grace_period_secondsoptional parameter toDeleteAlertPodParamsclasspod.delete()call to pass the grace period parameterImplementation Details
grace_period_secondsparameter is optional (defaults toNone), maintaining backward compatibilityNone, the pod's default grace period is used by Kubernetes0, the pod is deleted immediately without waitingpod.delete()methodhttps://claude.ai/code/session_01GT8gcjrboPS1NkX52BBeLD