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

No style for logs delimiter output #17734

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

pnasrat
Copy link
Contributor

@pnasrat pnasrat commented Dec 5, 2023

Use None style for minikube logs output

This change makes the logs output compatible with tail(1) removing leading *

Fixes #17733

Tested using go run and inspecting logs output.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 5, 2023
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 5, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @pnasrat. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 5, 2023
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@pnasrat
Copy link
Contributor Author

pnasrat commented Dec 5, 2023

Note the original code using style.Empty doesn't work as although it sets an empty low prefix

Empty: {Prefix: "", LowPrefix: ""},

The LowPrefix method defaults to returning LowBullet which is "* "

return LowBullet

@pnasrat
Copy link
Contributor Author

pnasrat commented Dec 5, 2023

Stepping through this I am also wondering if the style output code needs to handle style.Empty without the low bullet explicitly as looking at it, it accesses the style config map (edited)

s, ok := style.Config[st]

	s, ok := style.Config[st]
	if !s.OmitNewline {
		format += "\n"
	}

	// Similar to CSS styles, if no style matches, output an unformatted string.
	if !ok || JSON {
		return format, s.Spinner
	}

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

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

thank you for this PR @pnasrat would u mind pasting before after this PR output

@pnasrat
Copy link
Contributor Author

pnasrat commented Dec 6, 2023

@medyagh so checking a bit further it might be happening when redirecting the output of minikube logs (eg with > or. | pbcopy or whatever). and hitting the no color path of so if you just type minikube logs on OS X and ubuntu you won't see it. It is also present with minikube logs --file logs.txt

However based upon downloading multiple users logs from issues from users this is definitely getting in the uploaded logs.

But the below gist is is a diff of running minikube logs with and with out this at these versions and redirecting the output

minikube version && ./out/minikube version
minikube version: v1.32.0
commit: 8220a6eb95f0a4d75f7f2d7b14cef975f050512d
minikube version: v1.32.0
commit: 1d1c6f3c143e2d28fe63167ba90e3265538c6a3a

https://gist.github.com/pnasrat/b1482a82d01c4b34e1ecd12f895b096f

@pnasrat
Copy link
Contributor Author

pnasrat commented Dec 6, 2023

Full logs for comparison:

logs-before.txt
logs-after.txt

@spowelljr
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 12, 2023
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 17734) |
+----------------+----------+---------------------+
| minikube start | 51.0s    | 51.2s               |
| enable ingress | 27.4s    | 27.2s               |
+----------------+----------+---------------------+

Times for minikube start: 50.4s 53.5s 51.7s 50.1s 49.5s
Times for minikube (PR 17734) start: 54.6s 49.4s 49.6s 50.6s 51.8s

Times for minikube ingress: 23.7s 29.3s 28.2s 28.7s 27.2s
Times for minikube (PR 17734) ingress: 27.6s 26.1s 25.7s 28.7s 27.7s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 17734) |
+----------------+----------+---------------------+
| minikube start | 23.3s    | 23.7s               |
| enable ingress | 20.6s    | 20.0s               |
+----------------+----------+---------------------+

Times for minikube start: 21.5s 23.0s 25.0s 22.2s 25.1s
Times for minikube (PR 17734) start: 22.3s 21.8s 25.1s 24.5s 24.7s

Times for minikube ingress: 22.8s 18.3s 20.4s 21.8s 19.8s
Times for minikube (PR 17734) ingress: 21.8s 18.8s 18.8s 21.8s 18.8s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 17734) |
+----------------+----------+---------------------+
| minikube start | 22.3s    | 22.3s               |
| enable ingress | 31.9s    | 31.1s               |
+----------------+----------+---------------------+

Times for minikube start: 21.4s 21.7s 23.3s 24.3s 20.6s
Times for minikube (PR 17734) start: 23.5s 20.4s 23.1s 21.3s 23.2s

Times for minikube ingress: 31.3s 31.3s 18.4s 31.3s 47.3s
Times for minikube (PR 17734) ingress: 31.3s 31.3s 31.3s 30.3s 31.3s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
KVM_Linux TestRunningBinaryUpgrade (gopogh) 5.49 (chart)
Hyperkit_macOS TestMultiNode/serial/ProfileList (gopogh) 6.67 (chart)
Hyperkit_macOS TestMultiNode/serial/MultiNodeLabels (gopogh) 6.72 (chart)
Hyperkit_macOS TestMultiNode/serial/DeleteNode (gopogh) 6.77 (chart)
Hyperkit_macOS TestMultiNode/serial/RestartMultiNode (gopogh) 6.77 (chart)
Hyperkit_macOS TestMultiNode/serial/StopMultiNode (gopogh) 6.77 (chart)
Hyperkit_macOS TestMultiNode/serial/DeployApp2Nodes (gopogh) 8.15 (chart)
Hyperkit_macOS TestMultiNode/serial/FreshStart2Nodes (gopogh) 8.15 (chart)
Hyperkit_macOS TestMultiNode/serial/PingHostFrom2Pods (gopogh) 8.15 (chart)
Hyperkit_macOS TestMultiNode/serial/StartAfterStop (gopogh) 8.15 (chart)
Hyperkit_macOS TestMultiNode/serial/StopNode (gopogh) 8.15 (chart)
Hyperkit_macOS TestFunctional/serial/CacheCmd/cache/cache_reload (gopogh) 8.89 (chart)
Hyperkit_macOS TestFunctional/serial/CacheCmd/cache/verify_cache_inside_node (gopogh) 8.89 (chart)
Hyperkit_macOS TestFunctional/serial/KubeContext (gopogh) 8.89 (chart)
Hyperkit_macOS TestFunctional/serial/KubectlGetPods (gopogh) 8.89 (chart)
Hyperkit_macOS TestFunctional/serial/MinikubeKubectlCmd (gopogh) 8.89 (chart)
Hyperkit_macOS TestFunctional/serial/MinikubeKubectlCmdDirectly (gopogh) 8.89 (chart)
Hyperkit_macOS TestFunctional/serial/SoftStart (gopogh) 8.89 (chart)
KVM_Linux_crio TestFunctional/parallel/ImageCommands/ImageLoadDaemon (gopogh) 9.15 (chart)
Hyperkit_macOS TestNetworkPlugins/group/kindnet/Start (gopogh) 9.63 (chart)
Hyperkit_macOS TestMultiNode/serial/AddNode (gopogh) 12.59 (chart)
Hyperkit_macOS TestMultiNode/serial/CopyFile (gopogh) 12.59 (chart)
Hyperkit_macOS TestFunctional/serial/StartWithProxy (gopogh) 16.30 (chart)
Hyperkit_macOS TestMultiNode/serial/ValidateNameConflict (gopogh) 16.54 (chart)

To see the flake rates of all tests by environment, click here.

@spowelljr spowelljr merged commit 48a81a8 into kubernetes:master Dec 20, 2023
34 of 48 checks passed
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pnasrat, spowelljr

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-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 20, 2023
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

minikube logs output is not tail(1) format
6 participants