-
Notifications
You must be signed in to change notification settings - Fork 34
OCM-20815 | chore: adding debug logs for proxy creation error #126
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughError logging in the LaunchProxyInstanceWithAuth function is standardized from %s to %v format. An explicit log entry is added for FindProxyLaunchImage() failures. Error messages for subnet preparation, security group creation, key pair operations, instance tagging, and network setup are updated to use consistent verbose formatting. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5–10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
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.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pkg/test/vpc_client/proxy.go (1)
189-242: Debug logging currently leaks proxy credentials in plain text.In
setupMITMProxyServer, when authentication is enabled you buildauthScriptwith the literalusernameandpassword, then pass that full script ascmdtoExec_CMD. The subsequentlog.LogDebug("Run the cmd successfully: %s", cmd)(Line 241) will log the entire multi-line shell/Python script, including the raw credentials, contradicting the security note at the top of the file and creating a serious secret-exposure risk.I recommend not logging the full command content here. For example, you can log only a step index or a short label instead of
cmd:- for _, cmd := range setupProxyCMDs { - _, err = Exec_CMD(CON.AWSInstanceUser, sshKey, hostname, cmd) - if err != nil { - return err - } - log.LogDebug("Run the cmd successfully: %s", cmd) - } + for i, cmd := range setupProxyCMDs { + _, err = Exec_CMD(CON.AWSInstanceUser, sshKey, hostname, cmd) + if err != nil { + return err + } + log.LogDebug("Run proxy setup command #%d successfully", i+1) + }This preserves useful debug information (progress through setup steps) without ever logging the actual command text or embedded credentials.
🧹 Nitpick comments (1)
pkg/test/vpc_client/proxy.go (1)
112-185: Logging changes inLaunchProxyInstanceWithAuthlook good; consider minor polish.Switching the error formatting from
%sto%von all thelog.LogErrorcalls correctly matches Go’s fmt-style handling oferrorvalues and will produce more useful messages. The added log whenFindProxyLaunchImagefails also makes this failure mode easier to diagnose from the caller’s perspective.One minor nit: the message
Add tag for instance %s failed(Line 161) still contains a double space before%s; you may want to normalize that while you’re touching the log line, but it’s purely cosmetic.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (1)
pkg/test/vpc_client/proxy.go(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Lint
- GitHub Check: Test (ubuntu-latest)
- GitHub Check: Test (windows-latest)
- GitHub Check: Test (macos-latest)
|
LGTM some linter issues |
|
Hi @gdbranco would you be able to merge this? |
Changed log format and extended logs whenever missing.