feat(ui): type the namespace when the cluster does not list them (#84)

Some users cannot list namespaces on a cluster. The add wizard showed
an error and offered no way forward.

The namespace step now switches to a text prompt when the list call
fails or returns nothing. The prompt shows the reason and checks that
the name is a valid DNS label. Esc from a later step returns to the
prompt.

The j and k keys now type into text fields. They moved the list cursor
before, so a name such as kube-system could not be typed.

Closes #66
This commit is contained in:
2026-10-02 02:28:58 +01:00
committed by GitHub
parent f3d3f259a1
commit 4748bc4be5
5 changed files with 196 additions and 5 deletions
+9
View File
@@ -1,6 +1,7 @@
package config
import (
"errors"
"fmt"
"regexp"
"strings"
@@ -697,6 +698,14 @@ func validateDNS1123Label(name, field, entityType string) *ValidationError {
return nil
}
// ValidateNamespaceName validates a Kubernetes namespace name (a DNS-1123 label).
func ValidateNamespaceName(name string) error {
if verr := validateDNS1123Label(name, "namespace", "Namespace"); verr != nil {
return errors.New(verr.Message)
}
return nil
}
// validateDNS1123Subdomain validates that a name is a valid DNS subdomain name (RFC 1123).
// Used for resource names which can contain dots.
func validateDNS1123Subdomain(name, field, entityType string) *ValidationError {