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

Commit

Permalink
Fixing docker host default (#548)
Browse files Browse the repository at this point in the history
* Prefer defaultHost

* no null

* fixing tests

* port as well
  • Loading branch information
jkotalik authored Jun 18, 2020
1 parent 9cbf1fd commit 224101f
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 14 deletions.
7 changes: 1 addition & 6 deletions src/Microsoft.Tye.Hosting/Model/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,8 @@ private static void GetEffectiveBindings(bool isDockerRunInfo, string defaultHos
foreach (var b in service.Description.Bindings)
{
var protocol = b.Protocol;
var host = b.Host ?? (isDockerRunInfo ? service.Description.Name : defaultHost);

var host = b.Host ?? defaultHost ?? (isDockerRunInfo ? service.Description.Name : "");
var port = b.Port;
if (b.Port is object && isDockerRunInfo)
{
port = b.ContainerPort ?? b.Port.Value;
}

bindings.Add(new EffectiveBinding(
service.Description.Name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ services:
- name: health-liveness
project: api/api.csproj
replicas: 3
bindings:
- port: 8002
liveness:
http:
path: /healthy
Expand Down
2 changes: 0 additions & 2 deletions test/E2ETest/testassets/projects/health-checks/tye-none.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ services:
- name: health-none
project: api/api.csproj
replicas: 3
bindings:
- port: 8001

2 changes: 0 additions & 2 deletions test/E2ETest/testassets/projects/health-checks/tye-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ services:
- name: health-proxy
project: api/api.csproj
replicas: 2
bindings:
- port: 8005
liveness:
http:
path: /healthy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ services:
- name: health-readiness
project: api/api.csproj
replicas: 3
bindings:
- port: 8003
readiness:
http:
path: /ready
Expand Down

0 comments on commit 224101f

Please sign in to comment.