| 232 | } |
| 233 | |
| 234 | func validateRoute(routeName string, domainType string, port int, path string) error { |
| 235 | if domainType == tcp && path != "" { |
| 236 | return errors.New(T("Path not allowed in TCP route {{.RouteName}}", |
| 237 | map[string]interface{}{ |
| 238 | "RouteName": routeName, |
| 239 | }, |
| 240 | )) |
| 241 | } |
| 242 | |
| 243 | if domainType == "" && port != 0 { |
| 244 | return errors.New(T("Port not allowed in HTTP route {{.RouteName}}", |
| 245 | map[string]interface{}{ |
| 246 | "RouteName": routeName, |
| 247 | }, |
| 248 | )) |
| 249 | } |
| 250 | |
| 251 | return nil |
| 252 | } |
| 253 | |
| 254 | func replaceHostname(domainType string, hosts []string, hostname *string) { |
| 255 | if domainType == "" && len(hosts) > 0 && hosts[0] != "" { |