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

fix: add preExec to Run #368

Merged
merged 4 commits into from
Sep 27, 2024
Merged

fix: add preExec to Run #368

merged 4 commits into from
Sep 27, 2024

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Sep 27, 2024

Fixes #364

Adds the capability for Run() to run defers defined outside of Run().
Currently the only use-case for this is to close the Coder logger.
Also adds an integration test that validates this behaviour and ensures that closeLogs gets called.

@johnstcn johnstcn self-assigned this Sep 27, 2024
@johnstcn johnstcn changed the title fix: add preExec to Run and RunCacheProbe fix: add preExec to Run Sep 27, 2024
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

LGTM!

cmd/envbuilder/main.go Outdated Show resolved Hide resolved
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
@johnstcn johnstcn merged commit 481e3a9 into main Sep 27, 2024
4 checks passed
@johnstcn johnstcn deleted the cj/defer-cmd-envbuilder branch September 27, 2024 16:33
johnstcn added a commit that referenced this pull request Sep 27, 2024
Fixes #364

Adds the capability for Run() to run defers defined outside of Run().
Currently the only use-case for this is to close the Coder logger.
Also adds an integration test that validates this behaviour and ensures that closeLogs gets called.

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
(cherry picked from commit 481e3a9)
johnstcn added a commit that referenced this pull request Sep 27, 2024
johnstcn added a commit that referenced this pull request Sep 27, 2024
johnstcn added a commit that referenced this pull request Sep 27, 2024
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.

Defers run in cmd/envbuilder won't execute because Run performs execve(2)
2 participants