MCPcopy Create free account
hub / github.com/cloudfoundry/cli / validateRoute

Function validateRoute

cf/actors/routes.go:234–252  ·  view source on GitHub ↗
(routeName string, domainType string, port int, path string)

Source from the content-addressed store, hash-verified

232}
233
234func 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
254func replaceHostname(domainType string, hosts []string, hostname *string) {
255 if domainType == "" && len(hosts) > 0 && hosts[0] != "" {

Callers 1

FindAndBindRouteMethod · 0.85

Calls 1

NewFunction · 0.92

Tested by

no test coverage detected