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

Multiapps controller URL should be calculated based on the shared domains #184

Open
danail-branekov opened this issue Nov 10, 2023 · 1 comment

Comments

@danail-branekov
Copy link
Member

Description

README/Configuration says:

MULTIAPPS_CONTROLLER_URL=<URL> - By default, the plugin attempts to deduce the multiapps-controller URL based on the available shared domains.

However, this is not true. The deploy-service-url-calculator would strip the first segment on the API URL and prepend it with deploy-service. Instead, it should really check shared domains.

Here is a sample setup:

❯ cf api
API endpoint:   https://cfapi.172.17.0.1.nip.io
API version:    3.117.0+cf-k8s

❯ cf domains
Getting domains in org trinity as [email protected]...

name                     availability   internal   protocols
apps.172.17.0.1.nip.io   shared                    http

With this setup the calculator would calculate deploy-service.172.17.0.1.nip.io which is incorrect, it should be deploy-service.apps.172.17.0.1.nip.io

Even better, I think the plugin could get the route to the deploy service app instead of calculating it:

❯ cf apps
Getting apps in org trinity / space deploy-service as [email protected]...

name             requested state   processes                       routes
deploy-service   started           web:1/1, task:0/0, tomcat:0/0   deploy-service.apps.172.17.0.1.nip.io

Your environment

  • MultiApps CF CLI Plugin version - 3.0.3

Steps to reproduce

  • Configure deployment with a shared domain that is different from the API domain
  • Try to cf deploy - the plugin uses incorrect controller URL
@theghost5800
Copy link
Contributor

Hi @danail-branekov , you are right that documentation about MULTIAPPS_CONTROLLER_URL env is not right. Calculation of deploy service url calculator is changed since release of version 3.0.0. It will get cf api url and replace/add "deploy-service" as a hostname to the domain.

Before release of version 3.0.0 the plugin will make http call to v2/shared_domains call, add "deploy-service" as host to every domain and it will make http request on every domain until some of them respond with status code 200. This change was made because of initial plans to remove v2 cf api at all and resolve issues with cloudfoundry landscapes where shared(public) domains doesn't exists.

In the current situation, it will be necessary to specify url to deploy-service application in MULTIAPPS_CONTROLLER_URL env.

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

2 participants