Skip to content

Commit bd288af

Browse files
authored
add expose-as option
fixes: #204 * add expose-as option
1 parent 8528eaa commit bd288af

File tree

4 files changed

+151
-121
lines changed

4 files changed

+151
-121
lines changed

_docs/deployment.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ services:
4646
depends-on:
4747
- service: db-pool
4848
expose:
49-
- port: 80
50-
to:
51-
- global: true
5249
- port: 443
50+
as: 8080
5351
to:
5452
- global: true
5553

sdl/v1.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ type v1Service struct {
2525

2626
type v1Expose struct {
2727
Port uint32
28+
As uint32
2829
Proto string `yaml:",omitempty"`
2930
To []v1ExposeTo `yaml:",omitempty"`
3031
}
@@ -180,10 +181,11 @@ func (sdl *v1) Manifest() (*types.Manifest, error) {
180181
for _, expose := range svc.Expose {
181182
for _, to := range expose.To {
182183
msvc.Expose = append(msvc.Expose, &types.ManifestServiceExpose{
183-
Service: to.Service,
184-
Port: expose.Port,
185-
Proto: expose.Proto,
186-
Global: to.Global,
184+
Service: to.Service,
185+
Port: expose.Port,
186+
ExternalPort: expose.As,
187+
Proto: expose.Proto,
188+
Global: to.Global,
187189
})
188190
}
189191
}

0 commit comments

Comments
 (0)