Init logging cleanups/refactoring
~~Based on and currently includes #3375. Draft until that one is merged.~~
This
- moves logging setup out of
func init()and intoStartInitialization()(where it should belong); - moves
StartInitalizationfromfactory_linux.gotoinit_linux.go; - slightly simplifies
newContainerInitand its callers.
This concludes the spring cleaning started in #3354 (promise). Loosely based on parts of #3316.
Fixes: #3316.
Rebased on top of recently rebased #3375
Rebased; no longer a draft! Also, this concludes what was started as #3316
@opencontainers/runc-maintainers PTAL
Rebased; @opencontainers/runc-maintainers PTAL (this concludes a very long and heavy refactoring, the new code is easier to follow and understand).
@thaJeztah @AkihiroSuda @cyphar PTAL
The first commit still has this paragraph in the commit message, which no longer appears to be the case;
Remove logrus setup and use from TestMain/init, in preparation for the next commit.
The first commit still has this paragraph in the commit message, which no longer appears to be the case;
Remove logrus setup and use from TestMain/init, in preparation for the next commit.
@thaJeztah why do you think so? The first commit removes the logrus setup from TestMain, and it also removes logrus use from init() in the same file.
@opencontainers/runc-maintainers anything I can do to move this forward? This is a code cleanup and I hate to redo it again.
Rebased, reworked to make review easier (please review commit-by-commit).
Let me simplify this even further.
OK, I wanted to remove logging from the Go part of runc init, but decided to not do it. So, going back to the original plan.
In short, this is a series of small commits that untangle some logic around runc init (mostly the logging part), hopefully making it easier to grok. In the process, I am fixing a very minor and subtle bug of not reporting the unable to convert _LIBCONTAINER_INITPIPE.
It's hard to split changes to separate small commits, as they are all inter-dependent. But I did another try; PTAL.
OK, maybe so many commits are way too much to digest. I have separated some prep commits to #3854, and made this one a draft. Once #3854 is merged, there will only be two commits to review here.
@thaJeztah @AkihiroSuda PTAL
Needs rebase
Rebased. @lifubang @thaJeztah PTAL