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 override for log-to-stdout cmdline option #391

Merged
merged 4 commits into from
Mar 5, 2023
Merged

Fix override for log-to-stdout cmdline option #391

merged 4 commits into from
Mar 5, 2023

Conversation

PKizzle
Copy link
Contributor

@PKizzle PKizzle commented Mar 2, 2023

Updates github.com/urfave/cli/v2 to v.2.24.4 which allows the usage of the Count property for BoolFlag. This enables the detection of the cmdline flag being set or not and allows for correctly overriding the option from the toml config.
The corresponding tests have been added as well.

Signed-off-by: Philipp Kolberg philipp.kolberg@t-online.de

Copy link
Member

@sctb512 sctb512 left a comment

Choose a reason for hiding this comment

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

It seems that we forgot to add toml:"log_to_stdout" to LoggingConfig.LogToStdout and its tests.

You can find the changes here: https://github.com/containerd/nydus-snapshotter/pull/380/commits

Others, looks great to me.

@PKizzle
Copy link
Contributor Author

PKizzle commented Mar 3, 2023

I re-added the log_to_stdout option where it was removed by the mentioned commits.

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.20 ⚠️

Comparison is base (2fc62a6) 28.08% compared to head (be666b7) 27.88%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #391      +/-   ##
==========================================
- Coverage   28.08%   27.88%   -0.20%     
==========================================
  Files          40       40              
  Lines        4084     4077       -7     
==========================================
- Hits         1147     1137      -10     
- Misses       2798     2801       +3     
  Partials      139      139              
Impacted Files Coverage Δ
cmd/containerd-nydus-grpc/pkg/command/flags.go 100.00% <100.00%> (ø)
config/config.go 28.94% <100.00%> (-4.66%) ⬇️
pkg/blob/blob_manager.go 29.59% <0.00%> (-3.07%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@sctb512 sctb512 left a comment

Choose a reason for hiding this comment

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

LGTM

@sctb512
Copy link
Member

sctb512 commented Mar 5, 2023

There is a legacy issue. We should also restore the configuration item log_to_stdout in the toml file. c07eaa4#diff-f4126e327c22a9a152759a185ad32dcb8ae69c1b785429a354815b0618754788L39

Copy link
Member

@changweige changweige left a comment

Choose a reason for hiding this comment

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

Many thanks for bringing this trick into nydus-snapshotter !

@changweige
Copy link
Member

There is a legacy issue. We should also restore the configuration item log_to_stdout in the toml file. c07eaa4#diff-f4126e327c22a9a152759a185ad32dcb8ae69c1b785429a354815b0618754788L39

It is already restored in this PR?

@@ -109,7 +109,7 @@ type DaemonConfig struct {
}

type LoggingConfig struct {
LogToStdout bool
LogToStdout bool `toml:"log_to_stdout"`
Copy link
Member

Choose a reason for hiding this comment

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

@sctb512 The log_to_stdout config is already restored

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it does. But the log_to_stdout entry in misc/snapshotter/config.toml is lost.

Copy link
Member

Choose a reason for hiding this comment

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

Yes. another PR should be raised to fix the example config toml

@changweige changweige merged commit d925eb5 into containerd:main Mar 5, 2023
@PKizzle PKizzle deleted the fix-cmdline-toml-override branch March 5, 2023 18:12
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.

None yet

4 participants