runc icon indicating copy to clipboard operation
runc copied to clipboard

Init logging cleanups/refactoring

Open kolyshkin opened this issue 4 years ago • 8 comments

~~Based on and currently includes #3375. Draft until that one is merged.~~

This

  • moves logging setup out of func init() and into StartInitialization() (where it should belong);
  • moves StartInitalization from factory_linux.go to init_linux.go;
  • slightly simplifies newContainerInit and its callers.

This concludes the spring cleaning started in #3354 (promise). Loosely based on parts of #3316.

Fixes: #3316.

kolyshkin avatar Feb 19 '22 00:02 kolyshkin

Rebased on top of recently rebased #3375

kolyshkin avatar Mar 23 '22 18:03 kolyshkin

Rebased; no longer a draft! Also, this concludes what was started as #3316

kolyshkin avatar Mar 27 '22 01:03 kolyshkin

@opencontainers/runc-maintainers PTAL

kolyshkin avatar Apr 09 '22 01:04 kolyshkin

Rebased; @opencontainers/runc-maintainers PTAL (this concludes a very long and heavy refactoring, the new code is easier to follow and understand).

kolyshkin avatar May 11 '22 21:05 kolyshkin

@thaJeztah @AkihiroSuda @cyphar PTAL

kolyshkin avatar Jun 06 '22 22:06 kolyshkin

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 avatar Jul 02 '22 10:07 thaJeztah

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.

kolyshkin avatar Aug 04 '22 23:08 kolyshkin

@opencontainers/runc-maintainers anything I can do to move this forward? This is a code cleanup and I hate to redo it again.

kolyshkin avatar Dec 15 '22 23:12 kolyshkin

Rebased, reworked to make review easier (please review commit-by-commit).

kolyshkin avatar Apr 11 '23 23:04 kolyshkin

Let me simplify this even further.

kolyshkin avatar Apr 11 '23 23:04 kolyshkin

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.

kolyshkin avatar Apr 19 '23 22:04 kolyshkin

It's hard to split changes to separate small commits, as they are all inter-dependent. But I did another try; PTAL.

kolyshkin avatar Apr 28 '23 23:04 kolyshkin

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.

kolyshkin avatar May 03 '23 02:05 kolyshkin

@thaJeztah @AkihiroSuda PTAL

kolyshkin avatar Jun 06 '23 00:06 kolyshkin

Needs rebase

AkihiroSuda avatar Jul 17 '23 15:07 AkihiroSuda

Rebased. @lifubang @thaJeztah PTAL

kolyshkin avatar Aug 04 '23 20:08 kolyshkin