Skip to content
This repository was archived by the owner on Nov 20, 2023. It is now read-only.

Commit 224101f

Browse files
authored
Fixing docker host default (#548)
* Prefer defaultHost * no null * fixing tests * port as well
1 parent 9cbf1fd commit 224101f

File tree

5 files changed

+1
-14
lines changed

5 files changed

+1
-14
lines changed

src/Microsoft.Tye.Hosting/Model/Application.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,8 @@ private static void GetEffectiveBindings(bool isDockerRunInfo, string defaultHos
148148
foreach (var b in service.Description.Bindings)
149149
{
150150
var protocol = b.Protocol;
151-
var host = b.Host ?? (isDockerRunInfo ? service.Description.Name : defaultHost);
152-
151+
var host = b.Host ?? defaultHost ?? (isDockerRunInfo ? service.Description.Name : "");
153152
var port = b.Port;
154-
if (b.Port is object && isDockerRunInfo)
155-
{
156-
port = b.ContainerPort ?? b.Port.Value;
157-
}
158153

159154
bindings.Add(new EffectiveBinding(
160155
service.Description.Name,

test/E2ETest/testassets/projects/health-checks/tye-liveness.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ services:
55
- name: health-liveness
66
project: api/api.csproj
77
replicas: 3
8-
bindings:
9-
- port: 8002
108
liveness:
119
http:
1210
path: /healthy

test/E2ETest/testassets/projects/health-checks/tye-none.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,4 @@ services:
55
- name: health-none
66
project: api/api.csproj
77
replicas: 3
8-
bindings:
9-
- port: 8001
108

test/E2ETest/testassets/projects/health-checks/tye-proxy.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ services:
55
- name: health-proxy
66
project: api/api.csproj
77
replicas: 2
8-
bindings:
9-
- port: 8005
108
liveness:
119
http:
1210
path: /healthy

test/E2ETest/testassets/projects/health-checks/tye-readiness.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ services:
55
- name: health-readiness
66
project: api/api.csproj
77
replicas: 3
8-
bindings:
9-
- port: 8003
108
readiness:
119
http:
1210
path: /ready

0 commit comments

Comments
 (0)