[bugfix]: clean OCI leftovers before the wasp-agent pod is removed#104
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
c96996a to
4e62d3f
Compare
two OCI files are being copied by wasp-agent into the host: hook configuration and hook script. These files remain on the filesystem even after wasp-agent is being removed from the node. This causes redundant execution of the OCI hook. these changes suggest removing the files before the pod terminates. The preStop hook is being called before SIGTERM is being sent to the pod. In case of forcefull deletion the hook will be skipped. Signed-off-by: Igor Bezukh <ibezukh@redhat.com>
OCI hook file path was hard-coded in multiple packages. move the path into a dedicated package for maintain consistency among multiple consumer packages. Signed-off-by: Igor Bezukh <ibezukh@redhat.com>
4e62d3f to
7adec95
Compare
|
Addresses #91 |
akalenyu
left a comment
There was a problem hiding this comment.
just few alternative to consider:
- emptydir (tied to pod lifecycle) stop using predicted paths on the host, let cri-o somehow know where it should look
- signal handlers in the go program (roughly equivalent to current suggestion, arguably missing those in general for faster teardown)
@akalenyu Thanks for the feedback! I was considering using signal handlers, but then realized that I can offload it to k8s, so less code to maintain. Also it seems like in the SIGKILL case both of them are useless :( |
sounds good |
Signed-off-by: Igor Bezukh ibezukh@redhat.com
two OCI files are being copied by wasp-agent into the host:
hook configuration and hook script. These files remain on the
filesystem even after wasp-agent is being removed from the node.
This causes redundant execution of the OCI hook.
these changes suggest removing the files before the pod terminates.
The preStop hook is being called before SIGTERM is being sent to the pod.
In case of forcefull deletion the hook will be skipped