From febd17201ddee9ea7b87eb6f51be5901045165be Mon Sep 17 00:00:00 2001 From: Raymond Sun Date: Sat, 29 May 2021 16:09:42 +0800 Subject: [PATCH] fix copy-paste (#1043) --- src/Microsoft.Tye.Core/ConfigModel/ConfigApplication.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.Tye.Core/ConfigModel/ConfigApplication.cs b/src/Microsoft.Tye.Core/ConfigModel/ConfigApplication.cs index c9585400..7093eaa2 100644 --- a/src/Microsoft.Tye.Core/ConfigModel/ConfigApplication.cs +++ b/src/Microsoft.Tye.Core/ConfigModel/ConfigApplication.cs @@ -118,8 +118,8 @@ namespace Microsoft.Tye.ConfigModel foreach (var envVar in service.Configuration) { - context = new ValidationContext(service); - if (!Validator.TryValidateObject(service, context, results, validateAllProperties: true)) + context = new ValidationContext(envVar); + if (!Validator.TryValidateObject(envVar, context, results, validateAllProperties: true)) { throw new TyeYamlException( $"Environment variable '{envVar.Name}' of service '{service.Name}' validation failed." + Environment.NewLine + @@ -129,8 +129,8 @@ namespace Microsoft.Tye.ConfigModel foreach (var volume in service.Volumes) { - context = new ValidationContext(service); - if (!Validator.TryValidateObject(service, context, results, validateAllProperties: true)) + context = new ValidationContext(volume); + if (!Validator.TryValidateObject(volume, context, results, validateAllProperties: true)) { throw new TyeYamlException( $"Volume '{volume.Source}' of service '{service.Name}' validation failed." + Environment.NewLine +