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

Pass debug flag to elemental client if requested #58

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

davidcassany
Copy link
Contributor

@davidcassany davidcassany commented Jul 18, 2022

Related to #50

Signed-off-by: David Cassany dcassany@suse.com

Signed-off-by: David Cassany <dcassany@suse.com>
@davidcassany davidcassany requested a review from fgiudici July 18, 2022 13:42
Copy link
Member

@fgiudici fgiudici left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -293,7 +293,11 @@ func callElementalClient(conf cfg.Elemental, cloudInitPath string) error {
return err
}

installerOpts := []string{"elemental", "install"}
installerOpts := []string{"elemental"}
if conf.Install.Debug {
Copy link
Member

Choose a reason for hiding this comment

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

So, we would not need anymore to export the env var ELEMENTAL_DEBUG (if it ever worked)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes we do not need it, however passing it should not hurt.

If you are curious the reasoning is the following:

elemental-cli reads environmental variables and maps those against it's own config struct (which is also mapped to a config yaml). However elemental-cli does not have the debug flag as part of the configuration structure, it simply sets the log level from the given flag directly as soon as the command line is executed and never stores the flag anywhere. When the environment variables are parsed they mapped against a config struct, so the debug variable is simply ignored. Moreover, at that stage, the logger is already configured.

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.

2 participants