Silently ignore container update failure when the container is already gone#107
Merged
Merged
Conversation
Signed-off-by: Igor Bezukh <ibezukh@redhat.com>
the tool will help with automated testing of the generated OCI hook script. Signed-off-by: Igor Bezukh <ibezukh@redhat.com>
Signed-off-by: Igor Bezukh <ibezukh@redhat.com>
now it is possile to validate the OCI hook script by running "make lint-hook-script". ShellCheck should be installed on the target execution environment. Signed-off-by: Igor Bezukh <ibezukh@redhat.com>
when the poststart hook is used together with systed cgroup driver there can be a race condition between the hook run and the systemd cgorup cleanup. It can happen on short lived containers such as containers that copy small files or run a single on shot quick command. the proposed solution is to ignore the udpate failure in case the container PID doesn't exist or if its a zombie. If the failure happens on a running container the error will be returned. in addition the script was refactored for the sake of simplicity we prefer to avoid multiple nested if conditions since its hard to follow for the reviewer. Signed-off-by: Igor Bezukh <ibezukh@redhat.com>
the tests will be run with bash script. fake components such as /proc, crun and container data are located at OCI-hook/testData and documented in the readme file. tests will be triggered by `make test` Signed-off-by: Igor Bezukh <ibezukh@redhat.com>
|
[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 |
Member
Author
|
/cc @Barakmor1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Igor Bezukh ibezukh@redhat.com
As described in #105 there is a problem with running poststart hook while systemd manages the cgroup.
In this PR we assume that a failure to run the update on the non existing container indicates the reproduction
of the issue and we silently ignore it. For any other case the error is bubbled up to the runtime.
In addition to prevent regression some tooling and testing was added to cover the OCI hook rendering
and OCI hook scripting use cases.