We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df5c7ac commit 7ef3d3dCopy full SHA for 7ef3d3d
pkg/cmd/namespace/common.go
@@ -16,7 +16,11 @@
16
17
package namespace
18
19
-import "strings"
+import (
20
+ "strings"
21
+ "unicode"
22
+ "errors"
23
+)
24
25
func objectWithLabelArgs(args []string) map[string]string {
26
if len(args) >= 1 {
@@ -39,3 +43,18 @@ func labelArgs(labelStrings []string) map[string]string {
39
43
40
44
return labels
41
45
}
46
+
47
+func validateNamespaceName(name string) error {
48
+ for _, c := range(name) {
49
+ if (
50
+ c == ' ' ||
51
+ unicode.IsLower(c) ||
52
+ unicode.IsNumber(c)) {
53
+ continue
54
+ }
55
56
+ return errors.New("invalid namespace name - use only lowercase alphanumeric characters and hyphens")
57
58
59
+ return nil
60
+}
0 commit comments