Bugfixes nov2025 pt2 (#5)

* UI bugfixes.
* Fix open port check during new fwd setup wizard
This commit is contained in:
2025-11-25 00:09:32 +00:00
committed by GitHub
parent 39fe4286b4
commit 49acba5679
8 changed files with 66 additions and 17 deletions
+18 -1
View File
@@ -144,8 +144,25 @@ func validateSelectorCmd(discovery *k8s.Discovery, contextName, namespace, selec
}
// checkPortCmd checks if a local port is available
func checkPortCmd(port int) tea.Cmd {
func checkPortCmd(port int, configPath string) tea.Cmd {
return func() tea.Msg {
// First check if port is already in the configuration
cfg, err := config.LoadConfig(configPath)
if err == nil {
// Check all forwards in config for this port
allForwards := cfg.GetAllForwards()
for _, fwd := range allForwards {
if fwd.LocalPort == port {
return PortCheckedMsg{
port: port,
available: false,
message: fmt.Sprintf("✗ Port %d already assigned to %s", port, fwd.ID()),
}
}
}
}
// Then check if port is available at OS level
available, processInfo, err := k8s.CheckPortAvailability(port)
msg := ""