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

Bugfix/logf newline #57583

Merged
merged 1 commit into from Feb 22, 2018

Conversation

@MorrisLaw
Copy link
Contributor

commented Dec 23, 2017

What this PR does / why we need it:
Removes all redundant new lines being passed into the Logf() function. This involved going through code in both test/e2e and test/e2e_node, finding the newline redundancies in calls to Logf() and removing them.

Which issue(s) this PR fixes:
Fixes #57102

Release note:

NONE
@dims

This comment has been minimized.

Copy link
Member

commented Dec 24, 2017

/ok-to-test
/release-label-none

@@ -259,6 +259,7 @@ func nowStamp() string {
}

func log(level string, format string, args ...interface{}) {
strings.TrimSuffix(format, "\n")

This comment has been minimized.

Copy link
@ncdc

ncdc Jan 2, 2018

Member

This doesn't mutate format, but instead returns a new string with the suffix trimmed. You'll need to pass the returned value to fmt.Fprintf.

This comment has been minimized.

Copy link
@timothysc

timothysc Jan 2, 2018

Member

Also, we shouldn't trim, vs. find and fix offenders in the logs.

This comment has been minimized.

Copy link
@ncdc

ncdc Jan 2, 2018

Member

👍

This comment has been minimized.

Copy link
@MorrisLaw

MorrisLaw Jan 4, 2018

Author Contributor

@timothysc can you clarify "find and fix offenders in the logs", I want to make sure I completely understand your review suggestion. Thank you! 😄

This comment has been minimized.

Copy link
@ncdc

ncdc Jan 4, 2018

Member

He means we should go through all the e2e code and remove any trailing newlines from log statements.

This comment has been minimized.

Copy link
@MorrisLaw

MorrisLaw Jan 4, 2018

Author Contributor

Thank you for the clarification @ncdc!

@@ -259,6 +259,7 @@ func nowStamp() string {
}

func log(level string, format string, args ...interface{}) {
strings.TrimSuffix(format, "\n")

This comment has been minimized.

Copy link
@timothysc

timothysc Jan 2, 2018

Member

Also, we shouldn't trim, vs. find and fix offenders in the logs.

@timothysc
Copy link
Member

left a comment

Please squash your commits.

Also, I'm not certain all the newlines are redundant in your removal, some appear to be separators on purpose.

@MorrisLaw

This comment has been minimized.

Copy link
Contributor Author

commented Feb 14, 2018

I've been pretty busy this past month. But I'm going to get working on this again. I'll be updating the PR soon, with your recommendations. Thank you @timothysc

@k8s-ci-robot k8s-ci-robot added size/XXL and removed size/L labels Feb 18, 2018

@MorrisLaw MorrisLaw force-pushed the MorrisLaw:bugfix/logf-newline branch from e1b5efe to 683f4ea Feb 18, 2018

@MorrisLaw MorrisLaw force-pushed the MorrisLaw:bugfix/logf-newline branch from 683f4ea to 510238e Feb 18, 2018

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Feb 18, 2018

@MorrisLaw: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-gke-gci 8896103 link /test pull-kubernetes-e2e-gke-gci
pull-kubernetes-cross 510238e link /test pull-kubernetes-cross
pull-kubernetes-e2e-gke 510238e link /test pull-kubernetes-e2e-gke

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@MorrisLaw MorrisLaw force-pushed the MorrisLaw:bugfix/logf-newline branch from 510238e to e724886 Feb 18, 2018

out-of-date

@timothysc
Copy link
Member

left a comment

/approve
/lgtm

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Feb 21, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MorrisLaw, timothysc

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

@k8s-github-robot

This comment has been minimized.

Copy link
Contributor

commented Feb 22, 2018

Automatic merge from submit-queue (batch tested with PRs 60158, 60156, 58111, 57583, 60055). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 714b19e into kubernetes:master Feb 22, 2018

13 checks passed

Submit Queue Queued to run github e2e tests a second time.
Details
cla/linuxfoundation MorrisLaw authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gke Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce Job succeeded.
Details
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-unit Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details

@MorrisLaw MorrisLaw deleted the MorrisLaw:bugfix/logf-newline branch Feb 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.