-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Masking http(s)_proxy password from startup output. #17116
Conversation
Welcome @rmsilva1973! |
Hi @rmsilva1973. 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 Once the patch is verified, the new status will be reflected by the 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. |
Can one of the admins verify this patch? |
Can u plz post a before after this PR output (with dummy passwords) |
@medyagh Sure. Here is a before |
@medyagh BTW: don't worry. The password on the first screenshot is completely bogus. It's not my password. 😉 |
/ok-to-test |
pkg/minikube/node/config.go
Outdated
@@ -47,6 +49,16 @@ func showVersionInfo(k8sVersion string, cr cruntime.Manager) { | |||
out.Infof("opt {{.docker_option}}", out.V{"docker_option": v}) | |||
} | |||
for _, v := range config.DockerEnv { | |||
parts := strings.Split(v, "=") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend, putting this into a func and then add unit tests for them.
in config_test.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@medyagh Will do that. But turns out "make test" is completely inconsistent in my WSL/Ubuntu-22.04. This function:
minikube/cmd/minikube/cmd/start_test.go
Line 570 in 4b4ad95
func TestValidatePorts(t *testing.T) { |
is failing on different ports each time I run "make test" and sometimes it's even running without any failures. To be sure it's not related to my commit, I ran it on the original repo and it's behaving the same way. Guess I'll try to figure out what's happening here before going any further. Perhaps should I file a new issue? What do you think?
Anyway... I'll also test on Ubuntu running on a Virtual Machine to rule out some WSL related quirky behaviour. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@medyagh Moved the mask password to a func and implemented config_test.go. Let me know how it looks.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Merging from upstream
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you very much the PR looks much better, just a few more changes and it would be ready to go
pkg/minikube/node/config_test.go
Outdated
output: "myDockerOption=value", | ||
}, | ||
{ | ||
input: "http_proxy=http://myproxy.company.com", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets use minikube domain name here, so we dont get spam
minikube.sigs.k8s.io
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
pkg/minikube/node/config_test.go
Outdated
output: "HTTPS_PROXY=http://[email protected]:8080", | ||
}, | ||
{ | ||
input: "https_proxy=https://mary:am$uT8zB([email protected]:8080", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets make this word obvious it is a fake password
such as
mary@iam$Fake!password
also lets make more example of password with other types of characters such as ' %&* (things that could break our regex)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improved the regex robustness and the tests. I can't remember torturing regexes that much since I used to parse sendmail logs on SunOS 4.. 😊
Anyway, this is my first PR and I'm thankful for the feedback. I hope it's better now.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
/retest-this-please |
kvm2 driver with docker runtime
Times for minikube start: 50.4s 51.4s 51.7s 51.6s 52.0s Times for minikube ingress: 26.7s 28.3s 27.7s 27.7s 28.2s docker driver with docker runtime
Times for minikube start: 22.6s 22.2s 24.4s 24.7s 25.9s Times for minikube ingress: 20.8s 20.8s 20.9s 21.9s 20.9s docker driver with containerd runtime
Times for minikube (PR 17116) ingress: 31.4s 79.4s 31.4s 31.3s 31.3s Times for minikube start: 24.1s 24.3s 23.5s 23.2s 24.0s |
These are the flake rates of all failed tests.
To see the flake rates of all tests by environment, click here. |
Hey @medyagh . Do you think it's ok to merge now? |
thank you for this contribution @rmsilva1973 I look forward to see more contributions from you |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: medyagh, rmsilva1973 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 |
fixes #17115