Update Web IDE config to accept ports
What does this MR do?
In order to implement https://gitlab.com/gitlab-org/gitlab-ee/issues/5276 we need several modifications on the Web ide configuration. We need to accept a ports
section in both the main image section and in each service one.
In this MR we update the configuration and also modify other parts to include it.
This is an example of the new ports
options in .gitlab-webide.yml
:
terminal:
image:
name: alpine:3.9
ports:
- 80
services:
- name: tomcat
alias: tomcat
ports:
- external_port: 8080
protocol: http
- name: tomcat
alias: tomcat2
ports:
- external_port: 8080
internal_port: 80
name: main_port
- external_port: 8081
name: secondary_port
- name: tomcat
alias: tomcat3
ports:
- [8080, 80]
The ports
configuration can accept different options:
- Only one port. In this option the
internal_port
is the same as theexternal_port
.
ports:
- 80
- An array of two values. In this option the first value is the external port and the second one the internal.
ports:
- [80, 81]
-
A hash. The accepts the keys:
external_port
,internal_port
,protocol
andname
.- If no
internal_port
is set, the value ofexternal_port
will be used
- If no
ports:
- external_port: 8080
internal_port: 8081
protocol: http
name: port_name
-
By default all services are
protocol=http
-
Inside the same service, you can't have different ports pointing to the same external or internal port.
-
Each
internal_port
must be unique within the configuration -
If there is more than one service you are forced to set a port name.
-
If only one port is set,
default_port
will be used as the port name -
When the proxy endpoint is requested you can use either the number or the name version of the port
What are the relevant issue numbers?
Refs https://gitlab.com/gitlab-org/gitlab-ee/issues/5276 and closes https://gitlab.com/gitlab-org/gitlab-ee/issues/10179
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
EE specific content should be in the top level /ee
folder -
For a paid feature, have we considered GitLab.com plans, how it works for groups, and is there a design for promoting it to users who aren't on the correct plan? -
Security reports checked/validated by reviewer