Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

agent: shutdown vm on exit when agent is used as init process #179

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

Redent0r
Copy link

@Redent0r Redent0r commented Apr 18, 2024

Merge Checklist
  • Followed patch format from upstream recommendation: https://github.com/kata-containers/community/blob/main/CONTRIBUTING.md#patch-format
    • Included a single commit in a given PR - at least unless there are related commits and each makes sense as a change on its own.
  • Aware about the PR to be merged using "create a merge commit" rather than "squash and merge" (or similar)
  • genPolicy only: Ensured the tool still builds on Windows
  • genPolicy only: Updated sample YAMLs' policy annotations, if applicable
  • The upstream-missing label (or upstream-not-needed) has been set on the PR.
Summary

Linux kernel generates a panic when the init process exits. The kernel is booted with panic=1, hence this leads to a vm reboot.
When used as a service the kata-agent service has an ExecStop option which does a full sync and shuts down the vm. This patch mimicks this behavior when kata-agent is used as the init process.

Test Methodology

https://dev.azure.com/mariner-org/mariner/_build/results?buildId=552636&view=ms.vss-test-web.build-test-results-tab

Linux kernel generates a panic when the init process exits.
The kernel is booted with panic=1, hence this leads to a
vm reboot.
When used as a service the kata-agent service has an ExecStop
option which does a full sync and shuts down the vm.
This patch mimicks this behavior when kata-agent is used as
the init process.

Fixes: kata-containers#9429

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
@Redent0r Redent0r added the upstream/merged PRs that have been merged upstream label Apr 18, 2024
@Redent0r Redent0r marked this pull request as ready for review April 18, 2024 16:28
@Redent0r Redent0r requested review from a team as code owners April 18, 2024 16:28
Copy link
Collaborator

@sprt sprt left a comment

Choose a reason for hiding this comment

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

Merged upstream so LGTM.

@Redent0r Redent0r merged commit 9e73d0b into msft-main Apr 18, 2024
162 of 248 checks passed
@Redent0r Redent0r deleted the saulparedes/sync_downstream branch April 18, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream/merged PRs that have been merged upstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants