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

Method replaceDomain

cf/actors/routes.go:174–189  ·  view source on GitHub ↗
(routeWithoutPathAndPort string, domain string)

Source from the content-addressed store, hash-verified

172}
173
174func (routeActor routeActor) replaceDomain(routeWithoutPathAndPort string, domain string) (string, error) {
175 _, flagDomain, err := routeActor.FindDomain(domain)
176 if err != nil {
177 return "", err
178 }
179
180 switch {
181 case flagDomain.Shared && flagDomain.RouterGroupType == "": // Shared HTTP
182 host := strings.Split(routeWithoutPathAndPort, ".")[0]
183 routeWithoutPathAndPort = fmt.Sprintf("%s.%s", host, flagDomain.Name)
184 default:
185 routeWithoutPathAndPort = flagDomain.Name
186 }
187
188 return routeWithoutPathAndPort, nil
189}
190
191func (routeActor routeActor) FindAndBindRoute(routeName string, app models.Application, appParamsFromContext models.AppParams) error {
192 routeWithoutPath, path := routeActor.FindPath(routeName)

Callers 1

FindAndBindRouteMethod · 0.95

Calls 1

FindDomainMethod · 0.95

Tested by

no test coverage detected