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 log level to KCM #1155

Merged
merged 1 commit into from Dec 1, 2022
Merged

Conversation

atiratree
Copy link
Member

needed for testing the KCM https://issues.redhat.com/browse/WRKLDS-604

It seems to me that log level is passed correctly to the other controllers

@@ -96,6 +96,8 @@ func configure(cfg *config.MicroshiftConfig) (args []string, applyFn func() erro
}

args, err = mergeAndConvertToArgs(overrides)
args = append(args, fmt.Sprintf("-v=%d", cfg.LogVLevel))
Copy link
Contributor

@pacevedom pacevedom Nov 30, 2022

Choose a reason for hiding this comment

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

Does including

	"v": {fmt.Sprintf("%d", cfg.LogVLevel)},

To ExtendedArguments in overrides do the same? You wouldnt need this line.

Copy link
Member Author

Choose a reason for hiding this comment

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

@pacevedom Yup, looks better to use the same approach for both short and long arguments. I have modified GetKubeControllerManagerArgs to support that.

@@ -171,7 +173,11 @@ func GetKubeControllerManagerArgs(config map[string]interface{}) []string {
args := []string{}
for key, value := range extendedArguments.(map[string]interface{}) {
for _, arrayValue := range value.([]interface{}) {
args = append(args, fmt.Sprintf("--%s=%s", key, arrayValue.(string)))
if len(key) == 1 {
args = append(args, fmt.Sprintf("-%s=%s", key, arrayValue.(string)))
Copy link
Contributor

Choose a reason for hiding this comment

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

This should work with double dash too.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, you are right. But for example -h doesn't, so it shouldn't hurt anything to keep this here.

Copy link
Member Author

Choose a reason for hiding this comment

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

also a minor plus for consistency is that we are using -v in KCM operator as well when generating the args.

Nevertheless, I don't have a strong preference if you want to remove this.

Copy link
Contributor

Choose a reason for hiding this comment

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

log level verbosity flag in KCM supports simple or double dash. So this sounds good to me.

@oglok
Copy link
Contributor

oglok commented Dec 1, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 1, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 1, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: atiratree, oglok

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 1, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 1, 2022

@atiratree: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit 3007bf3 into openshift:main Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants