Validate the namespace name inside Environment::set_namespace
This prevents user error when copying namespace names output from other commands and pulling in e.g. control characters. We saw user confusion with errors like the below when talking to the k8s server:
Got unexpected status 500 Internal Server Error (Other(Ok(Some(Object {"apiVersion": String("v1"), "code": Number(500), "kind": String("Status"), "message": String("net/http: invalid header field value for \"X-Forwarded-Path\""), "metadata": Object {}, "reason": String("InternalError"), "status": String("Failure")}))), 179)
With this change the error message now shows upfront when setting the namespace, e.g.:
[dev-aws-us-west-2] [test-shard-hasnain-lakhani-spark-tls] [none] > namespace foo&
Invalid namespace name. Namespaces must be valid RFC 1123 labels (less than 64 characters, lowercase alphanumeric or '-', and start and end with an alphanumeric character)
Validate the namespace name inside Environment::set_namespace
This prevents user error when copying namespace names output from other commands and pulling in e.g. control characters. We saw user confusion with errors like the below when talking to the k8s server:
With this change the error message now shows upfront when setting the namespace, e.g.: