Remove "legacyPortMapping" from DefaultServiceEnricher
See original GitHub issueDescription
At the moment the DefaultServiceEnricher
maps the first exposed port from the image which is either 8080 or 9090 to the port 80 of the generated service, whereas all other exposed ports are mapped to the same service port. This is dangerous e.g. when in the image configuration the order of the ports changes (the order actually doesn’t matter for the docker image), then a different port can be mapped to 80.
Also the selection of 8080 and especially 9090 is a bit random (why not also 8181, 8282, 8000, 8001, …?
I suggest to get rid of this implicit mapping and allow a mapping in the enricher configuration. This could be
<enricher>
<config>
<fmp-service>
<ports>80=8080,81=9090</ports>
....
This could be shortened to <port>80</port>
if only one port is exposed.
If there are no objections, I would implement it that way, and would add this mapping to all quickstarts / devops / … images which currently have used this implicit service mapping (I would scrap in the generated yaml files).
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:13 (11 by maintainers)
Top GitHub Comments
Update now to the DefaultServiceEnricher to allow to remove the legacy mapping 8080 / 9090 --> 80.
It’s still enabled because I don’t know what apps it is going to affect as it is not backwards compatible.
Two new config options has been added:
If a build relies on the old, implicit mapping, the fix is to add:
as alternative, the property
fabric8.enricher.fmp-service.legacyPortMapping=true
can be set (that’s true btw for every generator / enricher config, and I plan to make it even more flexible to allow to useenricher.fmp-service.legacyPortMapping
,fmp-service.legacyPortMapping
andlegacyPortMapping
, too. at least as sytem properties when given from the outside.The question is, when should we switch over the mapping ? I suggest to make at least a 3.3.0 release to indicate this change.
@davsclaus @jstrachan @rawlingsj @jimmidyson @kameshsampath Any opinions on this ?
@davsclaus Its not the purpose to add the sample configuration above by default, only that you are able to provide a mapping in 1% of the use cases.