Browse Source

Treat IngressRuleBuilder.Service as non-null

davidfowl/ingress-changes
Ryan Nowak 7 years ago
parent
commit
84c43a0341
  1. 2
      src/Microsoft.Tye.Core/ApplicationFactory.cs
  2. 4
      src/Microsoft.Tye.Core/ConfigModel/ConfigIngressRule.cs
  3. 2
      src/Microsoft.Tye.Core/IngressRuleBuilder.cs

2
src/Microsoft.Tye.Core/ApplicationFactory.cs

@ -265,7 +265,7 @@ namespace Microsoft.Tye
{ {
Host = configRule.Host, Host = configRule.Host,
Path = configRule.Path, Path = configRule.Path,
Service = configRule.Service, Service = configRule.Service!, // validated elsewhere
}; };
ingress.Rules.Add(rule); ingress.Rules.Add(rule);
} }

4
src/Microsoft.Tye.Core/ConfigModel/ConfigIngressRule.cs

@ -2,12 +2,16 @@
// The .NET Foundation licenses this file to you under the MIT license. // The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information. // See the LICENSE file in the project root for more information.
using System.ComponentModel.DataAnnotations;
namespace Microsoft.Tye.ConfigModel namespace Microsoft.Tye.ConfigModel
{ {
public class ConfigIngressRule public class ConfigIngressRule
{ {
public string? Path { get; set; } public string? Path { get; set; }
public string? Host { get; set; } public string? Host { get; set; }
[Required]
public string? Service { get; set; } public string? Service { get; set; }
} }
} }

2
src/Microsoft.Tye.Core/IngressRuleBuilder.cs

@ -8,6 +8,6 @@ namespace Microsoft.Tye
{ {
public string? Path { get; set; } public string? Path { get; set; }
public string? Host { get; set; } public string? Host { get; set; }
public string? Service { get; set; } public string Service { get; set; } = default!;
} }
} }

Loading…
Cancel
Save