Skip to content

hooks: add support for job and cronjobs#2439

Merged
raghavendra-talur merged 1 commit intoRamenDR:mainfrom
asn1809:asn-exec-hook-jobs
Apr 8, 2026
Merged

hooks: add support for job and cronjobs#2439
raghavendra-talur merged 1 commit intoRamenDR:mainfrom
asn1809:asn-exec-hook-jobs

Conversation

@asn1809
Copy link
Copy Markdown
Member

@asn1809 asn1809 commented Mar 2, 2026

As of now, for exec hooks, deployments, daemonsets, statefulsets and pods are supported. Job and CronJob support is being added through this PR.

Assisted by AI

@asn1809 asn1809 marked this pull request as draft March 2, 2026 08:41
@asn1809 asn1809 force-pushed the asn-exec-hook-jobs branch 5 times, most recently from 29529e8 to 8724c7a Compare March 31, 2026 13:11
@asn1809 asn1809 marked this pull request as ready for review March 31, 2026 13:12
@asn1809 asn1809 force-pushed the asn-exec-hook-jobs branch 2 times, most recently from 48e47fa to 882f9a5 Compare March 31, 2026 17:37
Copy link
Copy Markdown
Member

@raghavendra-talur raghavendra-talur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one comment in exec_hook.go, other than that the rest of the code looks good to me.

Comment thread internal/controller/hooks/exec_hook.go Outdated
// If no pods are found and SkipHookIfNotPresent is false, return an error
// This will cause the controller to retry when pods become available
if len(execPods) == 0 {
if e.Hook.SkipHookIfNotPresent {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think SkipHookIfNotPresent applies for exec hooks. It was only meant for check hooks. In this case, if no pods are found, then we should treat it as an error. It is a user mistake if they specify exec hook for a job/cronjob which runs for a short interval.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

@asn1809 asn1809 force-pushed the asn-exec-hook-jobs branch from 882f9a5 to 0971db4 Compare April 3, 2026 17:01
As of now, for exec hooks, deployments, daemonsets, statefulsets and
pods are supported. Job and CronJob support is being added through this PR.

Assisted by Bob
Signed-off-by: Annaraya Narasagond <annarayanarasagond@gmail.com>
@asn1809 asn1809 force-pushed the asn-exec-hook-jobs branch from 0971db4 to 9431aeb Compare April 6, 2026 11:22
@raghavendra-talur raghavendra-talur merged commit d1f6eb3 into RamenDR:main Apr 8, 2026
24 checks passed
@asn1809 asn1809 deleted the asn-exec-hook-jobs branch April 8, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants