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

Return correct docker port #2974

Merged

Conversation

philippthun
Copy link
Member

@philippthun philippthun commented Sep 22, 2022

As outlined in #2976 the correct docker port from the desired droplet is only returned if the process does not need staging.

I've found the story "API should support docker apps not listening on port 8080" in PivotalTracker [1] and the corresponding commit in ccng [2]. The commit message contains a table which I'm repeating here in a simplified form:

App Lifecycle Staged Display
buildpack anything 8080
docker false 8080
docker true execution metadata 1st port OR 8080

According to this table the custom port from the Dockerfile (i.e. execution metadata) should only be returned if the docker app is staged. This PR changes the condition from "the process does not need staging" to "the desired droplet is staged" and thus prevents the wrong package state calculation for aborted deployments outlined in #2975.

Closes #2976

[1] https://www.pivotaltracker.com/n/projects/2196383/stories/167149569
[2] e1a87d7

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

During a rollback (e.g. canceled deployment) a wrong process/droplet
state was used resulting in the default port (8080) being returned.

With this change the port information from the desired droplet is used
if it is staged.
@philippthun philippthun marked this pull request as ready for review September 23, 2022 09:50
This test fails without the previous commit e1b36bd.
@philippthun philippthun merged commit 7912583 into cloudfoundry:main Sep 28, 2022
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

Successfully merging this pull request may close these issues.

Aborting the deployment of a docker app with custom port results in its route getting deleted
3 participants