refactor(wsl): support auto fix localhostforwarding#107
Merged
BlackHole1 merged 1 commit intooomol-lab:mainfrom Apr 25, 2025
Merged
refactor(wsl): support auto fix localhostforwarding#107BlackHole1 merged 1 commit intooomol-lab:mainfrom
BlackHole1 merged 1 commit intooomol-lab:mainfrom
Conversation
Signed-off-by: Kevin Cui <bh@bugs.cc>
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the WSL configuration compatibility checking to support auto-fixing issues for both kernel and localhost forwarding.
- The ExistIncompatible function is updated to return a list of incompatible configuration keys.
- The Fix function now applies corrections for both kernel and localhost forwarding issues with proper error handling.
- The checkWSLConfig function is modified to use the list of incompatible keys to provide more informative notifications.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/wsl/config.go | Refactors configuration compatibility functions and updates Fix to process multiple keys. |
| pkg/wsl/check.go | Updates configuration checking to handle a list of incompatible keys and pass them to the notification system. |
Comments suppressed due to low confidence (1)
pkg/wsl/config.go:44
- There is an inconsistency in key casing: in ExistIncompatible the key is appended as "localhostForwarding", while in Fix it is referenced as "localhostforwarding". Consider using a consistent casing for the key across the functions.
if err := c.commentKey("localhostforwarding"); err != nil {
ihexon
approved these changes
Apr 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.