Skip to content

prestop hooks aren't called when Jobs complete successfully #55807

Description

@srikumar-b

Is this a BUG REPORT or FEATURE REQUEST?: Y

Uncomment only one, leave it on its own line:

/kind bug

/kind feature

What happened:
lifecycle hook preStop is called only when user force-stop/kill the pod/job. It is not getting called when the pod is completed successfully.

What you expected to happen:
preStop hook should be called whenever the pod is exited either it is with success or failure
How to reproduce it (as minimally and precisely as possible):
just by following instructions from https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-details

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version):
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.kind/featureCategorizes issue or PR as related to a new feature.sig/cluster-lifecycleCategorizes an issue or PR as relevant to SIG Cluster Lifecycle.sig/nodeCategorizes an issue or PR as relevant to SIG Node.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions