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

Using portPropertyFile generates a file with no properties #592

Closed
talaieru opened this issue Oct 18, 2016 · 3 comments
Closed

Using portPropertyFile generates a file with no properties #592

talaieru opened this issue Oct 18, 2016 · 3 comments
Labels

Comments

@talaieru
Copy link

The parameter portPropertyFile is not honored. Basically when I use it, I end up with an empty properties file.

The reason for this is that in the current code the PortMapping code is created in two areas using the runService.getPortMapping method.

  1. When we start the docker images which makes sense (because we do all the logic of finding out the new ports and ip addresses).
  2. Just before exposing the container properties. Here it does not make sense to re-create it, because all the dynamic properties get lost, and as a result, no properties are written to the properties file (as far as I can see only the dynamic properties are written).

The proposed fix is simple: only create once the PortMapping objects and add them to the PropertyWriteHelper once the images has been started (and thus we assume that the dynamic assigned ports work properly).

talaieru pushed a commit to talaieru/docker-maven-plugin that referenced this issue Oct 18, 2016
… properties

The parameter portPropertyFile is not honored. Basically when I use it,
I end up with an empty properties file.

The reason for this is that in the current code the PortMapping code is
created in two areas using the runService.getPortMapping method.

1. When we start the docker images which makes sense (because we do all the
logic of finding out the new ports and ip addresses).

2. Just before exposing the container properties. Here it does not make sense
to re-create it, because all the dynamic properties get lost, and as a result,
no properties are written to the properties file (as far as I can see only
the dynamic properties are written to the property file).

The proposed fix is simple: only create once the PortMapping objects and add
them to the PropertyWriteHelper once the images has been started (and thus
we assume that the dynamic assigned ports work properly).
@rhuss
Copy link
Collaborator

rhuss commented Oct 23, 2016

Thanks a lot for the finding. I fixed it for the next version (there was some refactoring happening at that spot).

@rhuss rhuss added the fixed label Oct 23, 2016
@rhuss rhuss closed this as completed in 255f1bc Oct 23, 2016
@talaieru
Copy link
Author

Thanks!

On Sunday, October 23, 2016, Roland Huß notifications@github.com wrote:

Thanks a lot for the finding. I fixed it for the next version (there was
some refactoring happening at that spot).


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#592 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APgMHlfiv8vi9cUerZ9fTqWltUF0tA-Mks5q28EigaJpZM4KZofN
.

@talaieru
Copy link
Author

Thanks!

Sent from my iPhone

On Oct 23, 2016, at 22:18, Roland Huß notifications@github.com wrote:

Thanks a lot for the finding. I fixed it for the next version (there was some refactoring happening at that spot).


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants