Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route map/unmap without host #87

Open
gmllt opened this issue May 29, 2019 · 1 comment
Open

Route map/unmap without host #87

gmllt opened this issue May 29, 2019 · 1 comment

Comments

@gmllt
Copy link

gmllt commented May 29, 2019

CloudFoundry allows to map directly a domain to an application.

The cf-cli command cf map-route my-application application.cloudfoundry.dev is valid if the application.cloudfoundry.dev domain is created.

However, if the domain is created, the command cf map-route my-application cloudfoundry.dev --hostname application will fail as the route creation conflict with declared domain.

Manifest sample :

---
applications:
    -
        name: my-application
        routes:
            -
                route: application.cloudfoundry.dev

The plugin force the usage of cf map-route my-application cloudfoundry.dev -n application and fail at route creation.
Could it be interesting to try to execute the command cf map-route my-application application.cloudfoundry.dev after the first fail so it also try to map the route from a domain without host ?

func (p *BlueGreenDeploy) mapRoute(appName string, r plugin_models.GetApp_RouteSummary) {
	if _, err := p.Connection.CliCommand("map-route", appName, r.Domain.Name, "-n", r.Host); err != nil {
		if _, err := p.Connection.CliCommand("map-route", appName, r.Host+"."+r.Domain.Name); err != nil {
			p.ErrorFunc("Could not map route or domain", err)
		}
	}
}

(Same for the route unmapping)

gmllt added a commit to gmllt/cf-blue-green-deploy that referenced this issue May 29, 2019
…and unmapRoute methods (in case routes specified in app manifest are routes without hostname)

Sugggested in issue bluemixgaragelondon#87
@gmllt
Copy link
Author

gmllt commented May 29, 2019

Gti compare to explicit the modification : master...gmllt:map-unmap-routes-as-domains

gmllt added a commit to gmllt/cf-blue-green-deploy that referenced this issue Jun 7, 2019
respectively mapRoute and unmapRoute if route is not in format
'host.domain' but simply 'domain'

See: bluemixgaragelondon#87

DCO 1.1 Signed-off-by: Gilles Miraillet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant