Browse Source

directly use isvalidpart

Josh Yan 11 months ago
parent
commit
c365f195a8
1 changed files with 1 additions and 7 deletions
  1. 1 7
      types/model/name.go

+ 1 - 7
types/model/name.go

@@ -252,13 +252,7 @@ func (n Name) DisplayShortest() string {
 }
 }
 
 
 func IsValidNamespace(namespace string) bool {
 func IsValidNamespace(namespace string) bool {
-	name := Name{
-		Host:      "h",
-		Model:     "m",
-		Namespace: namespace,
-		Tag:       "t",
-	}
-	return name.IsValid()
+	return isValidPart(kindNamespace, namespace)
 }
 }
 
 
 // IsValid reports whether all parts of the name are present and valid. The
 // IsValid reports whether all parts of the name are present and valid. The