httpRoute, only put constrait on user tenant
@@ -108,32 +108,6 @@ func (r *HttpRoute) ValidateDelete() error {
return nil
}
-func IsHttpRouteSpecValidIfUsingKalmAppDomain(baseAppDomain, tenantName string, httpRouteSpec HttpRouteSpec) (bool, []int) {
- if baseAppDomain == "" {
- // invalid baseDomain always return false
- return false, []int{}
- }
-
- if tenantName == "" {
- // empty tenantName always return false
- return false, []int{}
- }
-
- var invalidIdx []int
- for i, host := range httpRouteSpec.Hosts {
- if !strings.HasSuffix(host, baseAppDomain) {
- continue
- }
-
- validSuffix := getValidSuffixOfAppDomain(tenantName, baseAppDomain)
- if !strings.HasSuffix(host, validSuffix) {
- invalidIdx = append(invalidIdx, i)
- }
- }
-
- return len(invalidIdx) == 0, invalidIdx
-}
-
func (r *HttpRoute) validate() error {
var rst KalmValidateErrorList
@@ -146,7 +120,10 @@ func (r *HttpRoute) validate() error {
}
tenantName := r.Labels[TenantNameLabelKey]
+ isUserTenant := tenantName != DefaultGlobalTenantName && tenantName != DefaultSystemTenantName
+ // only put constrait on user tenant
+ if isUserTenant {
baseAppDomain := GetEnvKalmBaseAppDomain()
if baseAppDomain == "" {
httproutelog.Error(fmt.Errorf("should set ENV for kalmBaseAppDomain"), "")
@@ -175,6 +152,7 @@ func (r *HttpRoute) validate() error {
}
}
}
+ }
for i, path := range r.Spec.Paths {
if !isValidPath(path) {
