|
|
@ -118,8 +118,8 @@ namespace Microsoft.Tye.ConfigModel |
|
|
|
|
|
|
|
|
foreach (var envVar in service.Configuration) |
|
|
foreach (var envVar in service.Configuration) |
|
|
{ |
|
|
{ |
|
|
context = new ValidationContext(service); |
|
|
context = new ValidationContext(envVar); |
|
|
if (!Validator.TryValidateObject(service, context, results, validateAllProperties: true)) |
|
|
if (!Validator.TryValidateObject(envVar, context, results, validateAllProperties: true)) |
|
|
{ |
|
|
{ |
|
|
throw new TyeYamlException( |
|
|
throw new TyeYamlException( |
|
|
$"Environment variable '{envVar.Name}' of service '{service.Name}' validation failed." + Environment.NewLine + |
|
|
$"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) |
|
|
foreach (var volume in service.Volumes) |
|
|
{ |
|
|
{ |
|
|
context = new ValidationContext(service); |
|
|
context = new ValidationContext(volume); |
|
|
if (!Validator.TryValidateObject(service, context, results, validateAllProperties: true)) |
|
|
if (!Validator.TryValidateObject(volume, context, results, validateAllProperties: true)) |
|
|
{ |
|
|
{ |
|
|
throw new TyeYamlException( |
|
|
throw new TyeYamlException( |
|
|
$"Volume '{volume.Source}' of service '{service.Name}' validation failed." + Environment.NewLine + |
|
|
$"Volume '{volume.Source}' of service '{service.Name}' validation failed." + Environment.NewLine + |
|
|
|