-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Cleanup/refactor create sandbox container #8397
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
Cleanup/refactor create sandbox container #8397
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8397 +/- ##
==========================================
+ Coverage 49.34% 49.55% +0.21%
==========================================
Files 153 153
Lines 17206 17235 +29
==========================================
+ Hits 8490 8541 +51
+ Misses 7649 7627 -22
Partials 1067 1067 |
d6c0ab7 to
8902f8b
Compare
8902f8b to
f8d411d
Compare
|
A friendly reminder that this PR had no activity for 30 days. |
99b171d to
779fada
Compare
|
a couple of unit, lint and build failures @littlejawa |
779fada to
afd7220
Compare
Take some code out of the createSandboxContainer() function and make it part of the Container package. Signed-off-by: Julien ROPÉ <[email protected]>
afd7220 to
c39a6a6
Compare
…tion Get some spec generation code out of createSandboxContainer() and make it a function under the contaienr package. Signed-off-by: Julien ROPÉ <[email protected]>
Make a function out of the code that deals with the default values in the security context. We need some of the fields to be non-nil, but we're checking them and setting default values where we need them. Instead, use a single function to set all default values appropriately, and call it once and for all at the beginning. Signed-off-by: Julien ROPÉ <[email protected]>
…ner() These functions are still accessing things that only the Server can use, so we can't put them directly in the container package. But splitting them helps simplify reading/maintaining createSandboxContainer(). Signed-off-by: Julien ROPÉ <[email protected]>
84bb265 to
66c0109
Compare
Looks like I fixed them... |
|
/test ci-fedora-kata |
|
@haircommander - do you think we can move forward with this? |
|
/approve LGTM, thanks @cri-o/cri-o-maintainers PTAL FYI @xw19 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander, littlejawa The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
noted |
|
/lgtm |
|
/test ci-e2e-evented-pleg |
|
/retest |
2 similar comments
|
/retest |
|
/retest |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This PR is made of cherry-pics from #8008: The refactoring that is done there can make sense outside of the PR.
The goal here is to reduce the complexity of createSandboxContainer() by extracting some functions. Some are moved to the factory/container code, others are just made sub-functions in the same file.
Hopefully, this can make createSandboxContainer() easier to maintain.
Which issue(s) this PR fixes:
None
Special notes for your reviewer:
I'm not sure that the way I split the functions makes sense in the way the "container" object is used. My focus was on code readability, and extracting related parts of the code as sub-functions. We can discuss it and adapt.
See this as a first draft.
Does this PR introduce a user-facing change?